If you set up WhatsApp to create a backup, you have the option to recover deleted messages on the app.
Recovering deleted text messages on Android is difficult, and the best strategy is to have Google Drive back up your phone.