How to edit messages on your iPhone
In Messages with iOS 16, iPadOS 16.1, macOS Sequoia, or later, you can edit a sent message up to five times within 15 minutes after you send it.
Edit a sent message in iOS 16 and later
In Messages, tap a conversation.
Touch and hold the message you want to edit.
Tap Edit.
4. Make your edits, then tap the checkmark to finalize the message, or tap the X to revert to the original message.
If you make edits, the word "Edited" appears under the message. You can edit an iMessage up to five times within 15 minutes after you send it.

Learn how to edit a message on Mac
To edit messages, use iMessage with iOS 18, iPadOS 18, macOS Sequoia, or later. If you edit a message to someone on an older version of iOS, iPadOS, or macOS, the updated version will appear as a second message that begins with “Edited to.”
Reveal all edits made to a message
In Messages, tap a conversation.
Scroll to the message that you want the edit history for.
Tap the word "Edited" under the current message to reveal the previous message or messages.
After someone edits a message, anyone in the conversation can tap the word "Edited" to see the edit history.