If you use iCloud Drive, any file that you store in iCloud Drive is also on your Mac. If you have Desktop and Documents enabled, those files are also available on your Mac and in iCloud. So, turning off the features will not erase any files.
If you have elected to optimize Mac Storage (system preferences > {name} > iCloud), then your oldest/largest files may have been offloaded only to the cloud if space was needed on your Mac. Those files (designated with a cloud icon) can be downloaded again to your Mac.
So, first check if you have the optimized setting turned on.
If so, verify that all of your files are on your Mac
And, turn it off.
If you do have desktop and documents turned on to sync to iCloud and turn it off, your desktop and documents folders will then be found in iCloud Drive on your Mac. Turning it off results in a new desktop and a new documents location on the Mac. Simply drag those files to the "new" locations. Nothing is lost and everything always remains on your Mac.