Hi
Follow the steps here, including contacting Apple Support (mail-in service may be available, if required), making a Genius Bar reservation or visiting an Apple Authorised Service Provider if necessary:
- If your iPhone, iPad, or iPod touch won’t connect to a Wi-Fi network - Apple Support
- Connect to Wi-Fi on your iPhone, iPad, or iPod touch - Apple Support
Apple's recommended settings for Wi-Fi routers and access points are detailed here:
Recommended settings for Wi-Fi routers and access points - Apple Support