Re: "Removing messages from iCloud : I have followed the steps to remove all messages from iCloud as I am starting to run out of storage space but nothing happens when I click on "turn off and delete"? "
As iCloud is mainly a service to sync files across multiple devices, I wonder which steps you followed and if you tried turning off sync of Messages, or where it was you clicked on "turn off and delete:.
Apple Support's online article: Set up iCloud for Messages on all your devices - Apple Support
Eg: says:
"Note: If you want to turn off Messages in iCloud on your Mac, deselect Enable Messages in iCloud. You can choose to disable Messages in iCloud for all of your devices, or just your Mac".
In Messages app: Try: Messages > Settings
Click iMessage
then deselect "Enable Messages in iCloud"
______________
Useful resource : iCloud User Guide iCloud User Guide - Apple Support
____________________________________
More info. / support / contact options etc: iCloud Support Website: iCloud - Official Apple Support
Wondering if you are using the newest compatible MacOS version for your iMac:
Eg: What's new in the updates for macOS Monterey - Apple Support Eg: says 12.7.6
If needed: (Wise to back-up Mac first): How to download and install macOS - Apple Support