Hello Andrjans,
Thanks so much for reaching out to Apple Support Communities in regards to your issue with your devices output through your AirPods. To help with this, please go to Settings > Sounds & Haptics and check the volume settings and if "Change with Buttons" option could be effecting this and test this again. If the issues only extend to typing messages, you can actually modify this setting to toggle Keyboard Clicks off. To do this, go to: Settings > Sounds & Haptics > Toggle Keyboard Clicks off.
For more information about adjusting audio and notifications, please refer to: Change iPhone sounds and vibrations
If the issue persists, we can also recommend trying to reset you AirPods. For guidance with this please refer to: Reset your AirPods
Be well!