Open the Messages app
Find the conversation containing the deleted text
If the message is still in Recently Deleted, open Messages
Tap Edit or Filters
Tap Show Recently Deleted
Select the messages
Tap Recover or Delete to remove them permanently
If the message is in a backup, turn off iCloud Messages if needed
Go to Settings
Tap your name
Tap iCloud
Tap Messages
Turn off Use on this iPhone
Delete the relevant backup from iCloud if you want it removed there
Go to Settings
Tap your name
Tap iCloud
Tap Manage Account Storage
Tap Backups
Select the device backup
Tap Delete Backup
If the text is in a synced device, delete it from all devices signed in to the same Apple ID
If needed, erase the iPhone completely
Go to Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Set up the iPhone again without restoring the old backup
