Connecting to Wifi is the first part and then getting connected to the Internet is the second
- If you connect to Wifi, doesn't necessarily mean you are connected to the internet. If you are not connected to wifi could be a problem with iPhone settings or Router/Modem Settings
- If you are not connected to the internet is the sole issue of Router / Modem Settings. Contact your ISP immediately
For your Internet connection.
- Over Cellular: contact your Carrier (Cellular Service Provider). The agency who issued the SIM to you
- Over WiFI: Contact your ISP (Internet Service Provider), the agency who provided the Internet Service on your Modem/Router to you
However --> Connect iPhone to the Internet - Apple Support