Water damage may affect an iPhone even after it's dried out and seems to be working again. If your iPhone has come into contact with even a few drops of water, it may stick in Headphone mode, preventing you from hearing sounds from the speaker. Try some fixes to try to reset the mode.
Check Audio Mode
Before you start troubleshooting, check what mode your iPhone thinks it is in. Remove your headphones, if they're plugged in, and press one of the volume buttons on the side of the handset. If you see the word headphones in the alert, you're in Headphone mode; if you see Ringer, you're in Speaker mode and may have a volume problem. Use the Volume Down button to empty the bars and then Volume Up until you reach the maximum volume level.
Restart and Reset the iPhone
Your iPhone settings may be a little buggy after water contact, and turning the iPhone off and on may refresh its system. To restart, press and hold down the Sleep/Wake button. Swipe the slider to close down the iPhone and press Sleep/Wake again to restart.
If this doesn't fix the problem, try resetting the iPhone. Hold the Sleep/Wake and Home buttons simultaneously for a few seconds until the Apple logo appears on the screen. Wait for the iPhone to reset and restart.
Enable Speaker Features
When you use audio speaker features, your iPhone switches to Speaker mode automatically. Enable these features to see if they force the iPhone out of Headphone mode.
Call the iPhone or make an outgoing call on it. When the call connects, tap the Speaker button.
Alternatively, open a voice mail message and start to play it. Tap the Speaker button.
Clean the Headphone Jack
Sometimes, an iPhone gets stuck in Headphone mode when the jack gets clogged with dust or debris. Blow in the jack to dislodge anything that might be stuck in the hole. Use a small cotton swab or toothpick to gently clean out the jack, or unbend a paperclip and use one of its ends to pull out debris. If you're using a toothpick or paperclip, wrap the end in a soft, lint-free cloth before inserting it.
If this doesn't fix the problem, make sure that the iPhone's screen is active and not on standby in Lock Screen mode. Plug your headphones in and out of the iPhone repeatedly for a couple of minutes, making sure to snap them in to place snugly each time. This may dislodge stubborn debris or prompt the iPhone to switch to Speaker mode.
Apple Support Options
If you can't get the iPhone to come out of Headphone mode, you may need to contact Apple for advice. Keep in mind that water damage automatically invalidates standard iPhone and AppleCare warranties. If you have an AppleCare+ plan, you may be eligible to have the iPhone repaired or replaced for a service fee. At the date of publication, this costs $79. Apple can tell when an iPhone has been wet — it has Liquid Contact Indicators that change color on contact with water. If Apple can't help, you may need to replace the iPhone or find a third-party repair option.