Do you want to completely turn off iCloud Drive so that no documents sync with iCloud? If so do the following after reading the rest of this post.
Go to Apple menu > System Settings > [username] > iCloud and then click on "Drive" and then turn iCloud Drive to off.
Also see the following from Add your Desktop and Documents files to iCloud Drive - Apple Support
What happens when you turn off iCloud Drive or sign out of iCloud
If you turn off iCloud Drive or sign out of iCloud, a new Desktop and Documents folder is created in your home folder. You also have the option to keep a local copy of your files that are in iCloud Drive. If you keep a local copy of your files in iCloud Drive, they're copied to a folder called iCloud Drive (Archive) in your home folder. You can move any files that were in your iCloud Desktop and Documents to your new local Desktop and Documents.
Or do you just want to turn off the Desktop and Dcouments option of iCloud Drive so that those folders will no longer sync with iCloud but you can still save files to the iCloud Drive folder and have those files sync with iCloud? If so, see the following from Add your Desktop and Documents files to iCloud Drive - Apple Support
Turn off Desktop and Documents
- From your Mac, choose Apple menu > System Settings.
- Click Apple Account. In macOS Sonoma or earlier, click Apple ID.
- Click iCloud.
- Under Saved to iCloud, click Drive. In macOS Sonoma or earlier, under Apps Using iCloud, click iCloud Drive.
- Turn off Desktop & Documents Folders.
- Click Done.
What happens when you turn off Desktop and Documents
When you turn off Desktop & Documents Folders, your files stay in iCloud Drive and a new Desktop and Documents folder is created on your Mac in the home folder. You can move files from iCloud Drive to your Mac as you need them, or select all of your files and drag them to the place you want to keep them.
Also note that it is possible to to leave iCloud Drive turned on (including the Desktop and Documents option if you want) and still have all files have a local copy on your Mac as well as a copy on iCloud. To do that, leave iCloud Drive (and the Desktop and Documents option if you want) turned on but insure that "Optimize Mac Storage" is turned off. That option is at Apple menu > System Settings > [username] > iCloud and then click on "Drive" then set "Optimize Mac Storage" to off.