Scroll down to the bottom of the screen, tap System
Tap Backup
Tap the Toggle next to Back up to Google Drive or Backup by Google One to turn it on
Tap Back up now
You will see SMS text messages towards the bottom of the screen along with the backup information
Additional Notes
If you do not have the option to backup SMS text messages, then there are third-party apps in the Google Play Store that may be able to backup and restore your messages.
Backup includes messages sent and received. This does not include MMS media.
If you're running Android 7.1 Nougat or below, your Google Account is able to sync apps, calendars, contacts, documents, and emails, but it cannot sync SMS and MMS messages