As far as I am aware, the messages can be deleted from iCloud, but they will be deleted on every device.
As for mail, you can set up a local ‘Archive’ file that you can store locally on your Mac. Just create a new Mailbox, and drop all your unwanted email in there. I do it all the time with mine.
The below link should offer a great starting point:
https://support.apple.com/en-gb/guide/mail/archive-emails-mail35918/mac
Hope this helps.