It is usually not possible to separate the audio for text and ringtones. The best thing would probably be to turn the volume down to a suitable volume.
You can also create an automation that automatically turns the ringtone down when you have connected your AirPods, and automatically turns it up again when they are no longer connected.
1. Open the Shortcuts app, tap Automation at the bottom and tap "+"
2. Find and select Bluetooth from the list
3. In Device, select either Any Device, or your AirPods.
4. Select "Is Connected" and select "Run Immediately" - and tap Next
5. Tap "New Blank Automation", then tap "Controls". Find and select Set Volume
6. Tap Media, and select Ringtone. Tap the % volume, and select your desired volume.
7. Tap Done.
Now the volume of your ring/text tone will automatically turn down to a suitable level when you connect your AirPods. To automatically turn the volume back up when you disconnect, create another automation. Do the same, but in Step 4, select "Is Disconnected" instead.
You can also adjust the volume of the system sounds from your AirPods. See here:
Adjust the volume of sound effects for AirPods - Apple Support (IN)