Hello jacketjacketjacket,
Welcome to Apple Support Communities. It sounds like you have a question about using Messages in iCloud. I'd be happy to provide information that may help.
To start take a look at the information here: Keep all your messages in iCloud. If you enable Messages in iCloud, deleting a message from your iPhone will delete it from iCloud as well.
If you'd like to optimize the storage on your iPhone, you may want to take a look the information here: How to check the storage on your iPhone, iPad, and iPod touch.
I hope that helps. Take care.