Welcome to Ask Different!

You can keep your pictures and videos on iCloud but off your MacBook (MB) by changing the following settings (for macOS Catalina) as described. Before doing any of the below, however, I recommend that you take a backup of your MB including all of the downloaded photos using the Time Machine app.

The particular setting I would suggest would allow you to store and see only the recent pictures from iCloud on your MB. For that, open your Photos app and then go to Photos > Preferences menu and click on the iCloud tab. There tick off iCloud Photos option. Once you do that a My Photo Stream option should appear and I suggest you select that one. You can also select Shared Albums if you want to have any such albums on your MB.

Once the iCloud Photos option is deactivated in the Photos preferences, you can delete all of the photos you can reach through the Library > Photos option in the left sidebar of the Photos app to clean up for space on your MB. This will not delete them from iCloud as long as you have ticked off the iCloud Photos in the preferences of Photos app.

You can check if you have changed the settings correctly and things are working as they should by deleting only one or two photos initially on your MB and see if the photos are still preserved in iCloud after a little while by going to https://www.icloud.com/photos/

If you don't want any pictures downloaded to your MB at all, then do not enable either the My Photo Stream or Shared Albums options after disabling iCloud Photos within the Photos preferences.

Another way to disable downloading of any of your photos to your MB at all is to go to System Preferences > Internet Accounts and click on iCloud. Then on the right, a number of options should appear starting with iCloud Drive and below that Photos. Tick off Photos to prevent pictures to be downloaded to your MB. This should also change the preferences in the Photos app and prevent My Photo Stream from being maintained even if selected within the preferences of Photos.