By default iCloud Photos and iCloud Drive keep a local copy on your Mac. If you want to reduce the local storage for iCloud Drive, see the following from Add your Desktop and Documents files to iCloud Drive - Apple Support
If you need more space on your device, iCloud Drive can help. On your Mac, choose Apple menu  > System Preferences. Click Apple ID, then click iCloud. On macOS Mojave or earlier, choose Apple menu  > System Preferences, then click iCloud. Turn on Optimize Mac Storage. Then your Mac keeps all of your recent files on your computer, but keeps your older ones only in iCloud, ready for you to download when you need them again.Â
If you want to reduce the space used locally for iCloud Photos, see the following from Set up and use iCloud Photos - Apple Support
On your Mac:
- Open the Photos app and click Photos in the menu bar.
- Click Preferences.
- Go to the iCloud tab and choose a storage setting.
If you turn on Optimize Storage, iCloud Photos automatically manages the size of your library on your device. Your original photos and videos are stored in iCloud and space-saving versions are kept on your device. Your library is optimized only when you need space, starting with the photos and videos you access least. You can download the original photos and videos over Wi-Fi or cellular when you need them. You can use Optimize Storage on your iPhone, iPad, iPod touch, and Mac.