As per this article https://support.apple.com/en-in/guide/mac-help/mchl1a02d711/mac
Move items to your Mac and remove them from iCloud Drive
- On your Mac, drag items from iCloud drive to another folder in the Finder sidebar or on the desktop, such as Downloads, Movies, Music and Pictures.
- The items are copied to your Mac and removed from iCloud Drive on all your devices set up for iCloud. If you change your mind, you can drag items back to iCloud Drive.
The second method is unchecking the box of iCloud Drive , you don't need to sign out the Apple ID from system preferences > iCloud .
open system preferences > iCloud and uncheck the box of iCloud Drive a pop up window appears , showing to keep a copy of documents , and remove from the Mac .
( a ) if you had clicked on keep a copy , they will be archived in home folder that can be viewed by clicking on finder in the dock , take cursor on top menu bar > Go > Home > your user name > iCloud Drive ( Archive ) .
Again checkmark the iCloud Drive box it will show setting up , the documents are archived , now you can right click the documents and delete they will move to trash , from finder > iCloud > Documents ( the documents will also get deleted / erased from iCloud.com but you have already archived them previously .
See the article https://support.apple.com/en-in/guide/mac-help/mchlp1093/10.14/mac/10.14