Select a use Undo Send within 2 minutes of sending it.
Go to the Messages app on your Mac.
Select the conversations in the sidebar, Control-click, then choose Delete.
Deleted messages and attachments remain in the Recently Deleted folder for 30 days, but you can permanently remove them before that.
Go to the Messages app Keep your messages up to date with iCloud in the iCloud User Guide.
Note: Any message that you delete from a conversation using Block and filter text messages in Messages on MacChange General settings in Messages on Mac