Keeping iCloud from erasing my Mac data

Enabling iCloud does not remove everything on the MacBook, and then transfer over the iCloud synced files to the MacBook. That's not how it works, so you don't have to be afraid of that.

If you want to ensure that files are always stored on your Mac, and not only in iCloud, then you want to ensure that the "Optimise Mac Storage" setting is not enabled. Open System Preferences > Apple ID and ensure that there's no checkmark besides "Optimise Mac Storage".

If you do have a checkmark there, files stored in the iCloud Drive could potentially be removed from your Mac in case available disk space runs low. They will be refetched from iCloud when needed.

Similarly for photos and videos synced to iCloud using the Photos app, you'll want to ensure "Optimise Mac Storage" is turned off. Open up Photos.app and open Preferences from the menu. In the iCloud tab, you'll want to ensure that "Optimise Mac Storage" is not selected - instead you'll want to choose "Download Originals to this Mac". This ensures that every photo and video store in iCloud is also stored on your Mac.