iCloud took my mac as a hostage-how to get back all my files?

.. and files are not available when i need them ..

macOS < 10.15:

System Preferences → iCloud → iCloud Drive options → Uncheck Optimise Storage.

macOS 10.15+:

System Preferences → Apple ID → iCloud Drive options → Uncheck Optimise Storage.

All files will be found locally, always, as well as on iCloud.

  • Can I safely uncheck the Optimise Mac Storage check box on the Apple ID - iCloud page?
  • https://support.apple.com/guide/mac-help/mchle5a61431/mac

For the second part,

What may seem counterintuitive is that your files are still stored in the iCloud ( which is perhaps why you thought you lost them).

To retrieve your files, you should open Finder and navigate to iCloud Drive, and then to the Documents folder within iCloud Drive. You should then manually transfer or copy the files from that directory to the local Documents directory on your computer. You should then do that same with your Desktop folder.

  • How to separate iCloud Drive from Desktop & Documents

You should uncheck the Optimize Storage button and wait for your files to finish downloading. Restart your computer if you don't see any progress right away.

When they've downloaded, you'll be able to move them instantly.