Personally, I would move some data to an external drive (and have a plan for offsite backup of that drive) or to a 3rd party cloud storage service.
Apple offers iCloud Backup for iPhones and iPads but not for Mac computers.
It is possible to sync data from a Mac to iCloud if you turn on those options (e.g., iCloud Photos, iCloud Drive including the Desktop & Documents option). Syncing has some of the benefits of a backup (and the benefit of being offsite) but is not the same as a backup. Major differences include the fact that not everything on your Mac can be synced and the fact that if you delete something, accidentally or otherwise, there is only a limited time period (30 days in most cases) during which it can be recovered.
Note that you would also need to turn on the "Optimize" options in iCloud Drive and in Photos as the default for both is to keep a local copy of the data on your Mac, so you wouldn't be freeing up any space there. This is the primary reason I would be looking at 3rd party alternatives if my goal was to free up space on my Mac.
More information on syncing in:
Set up and use iCloud Photos - Apple Support
and
iCloud Drive FAQ - Apple Support