Hello Maya niemeiec,
Thank you for using Apple Support Communities! I understand that your AirPods are unexpectedly disconnecting from your iPhone. You've come to the right place for a resolution.
Let's start by resetting the AirPods, then check if the behavior persists:
Get help with your AirPods - Apple Support
Specifically, follow the steps in this section to reset your AirPods:
"Still can’t connect? Follow these steps on your iOS device.
- Go to Settings > Bluetooth and tap the icon next to your AirPods.1 Then tap Forget This Device.
- Put your AirPods in the case and close the lid. Wait 15 seconds, then open the lid.
- Press and hold the setup button on the back of the case until you see the status light flash amber a few times, then flash white.
- Place your AirPods close to your device. Follow the steps on your iOS device's screen."
If there's no change afterwards, let's also confirm if the AirPods are selected as the audio source on your iPhone the next time they disconnect. The steps under the "Control audio" section in the following support article will walk you through how to check if your AirPods are selected:
Use and customize Control Center on your iPhone, iPad, and iPod touch - Apple Support
Cheers!