Phone won't connect to Wi-Fi or the internet
Don't worry, this is one of the most common phone problems, and a few simple checks fix it most of the time.
What to do
Step 1: Open Control Center by swiping down from the top-right corner (or up from the bottom on iPhones with a Home button). Make sure the airplane is off and the Wi-Fi symbol is on (blue).
Step 2: Check whether other devices in your home can get online. If none can, unplug your router, wait 30 seconds, plug it back in, and wait a few minutes.
Step 3: Restart your iPhone.
Step 4: Open Settings > Wi-Fi, tap the i next to your network, and tap Forget This Network. Then tap the network again and type the Wi-Fi password.
Step 5: If Wi-Fi isn't the problem, check cellular data: Settings > Cellular (or Mobile Service) and make sure Cellular Data (or Mobile Data) is on.
Step 6: Still nothing? Try Reset Network Settings (see the related answer). It won't delete photos or apps.
Still stuck? If no device in your home can get online, contact your internet provider; if only your phone can't, contact your carrier or the phone maker's support.