iOS 16 adds a long-awaited feature set that lets you modify and 'unsend' messages you've sent to someone in iMessage, but there's a time limit.
You can modify or cancel sending an iMessage up to 15 minutes after it is sent. After this time, the message is uneditable and can no longer be 'unsend'. However, these two features require both Message users to have iOS 16. If you try to unsend a message you sent to someone using iOS 15 or earlier, the option does not work and neither does the editing option. .
You can modify or 'unsend' an iMessage by long pressing on it in a conversation with iMessage and clicking "Edit" or "Undo Send".