It happens to the best of us. Every once in a while, iPhones stop accessing the Internet, either via Wi-Fi or cellular data connection.
Do not despair! Assuming that the Internet connection is working for other devices, there are two easy ways to reset your iPhone’s connection and get it working again.
To troubleshoot, enable Airplane mode to shut off the iPhone’s radios. Bring up Control Center and tap the Airplane mode button to turn it on. After a few seconds, tap the button again to turn it off.
If toggling Airplane mode doesn’t work, power down the iPhone by pressing and holding the top or side button (iPhone 8 or earlier) or both the side button and a volume button (iPhone X or later) until the slider appears. Or, go to:
Settings > General > Shut Down
Drag the slider to turn off the iPhone. Once the phone powers down, hold the side (or top) button again until the Apple logo appears.
In just a moment, your phone will be back on, and you should be able to access the Internet normally.