You'll need to look up specific directions for the model and type of phone you want to delete the text messages from.
If you give us the model of phone or type of phone you're trying to delete the messages from then we could help better.
If it's an Iphone you go to the settings app and tap on general, then tap on storage and Icloud usage, manage storage, which is below the Icloud section.
Select the device you wish to delete under Backups and then scroll to the bottom of the page and tap delete backup.
Then Tap Turn off and delete and the text messages will be permanently be deleted.
If it's an android phone look for the option of erasing private data and then scan and preview the text messages and then type Delete to confirm the deletion of the text messages.