Start with basic WiFi troubleshooting - as detailed here:
If your iPhone, iPad, or iPod touch won’t connect to a Wi-Fi network - Apple Support
Recommended settings for Wi-Fi routers and access points - Apple Support
Consider that your Router, to which you are attempting to connect, may be configured to require support for security features that are not supported by older versions of iOS. If you have an older iPad and your router is configured for WPA3 or WPA3/WPA2 mixed authentication, you will need to change this to WPA2 PSK(AES). Newer models of iPad support WPA3.
Some Mesh WiFi Routers are known to be troublesome in some circumstances.
If your WiFi has been set-up according to Apple’s recommended settings, WiFi and Internet connection difficulties are usually an indication that your device does not have a routable IP Address - your IP Address usually being assigned by DHCP. When this occurs, your iPad may only have a self-assigned link-local IP address that begins 169.254.x.x.
If you have a VPN App or profiles installed, or a security App such as Norton, these may be interfering with DHCP - and preventing your device from obtaining a valid IP Address for the WiFi network/hotspot to which you are attempting to connect. The resolution is usually simple; if installed, you may only need to temporarily disable or remove the Security App and/or VPN.
As for updating your iPad2, you're out of luck. The iPad2, iPad3 and iPad mini1 can only be updated to iOS 9.3.5 (WiFi Only models) or iOS 9.3.6 (WiFi & Cellular models).
Apple ended update support for these models in September 2016. These models of iPad cannot be updated to iOS 10 or later major versions of iOS, as the internal hardware does not meet the minimum technical requirements for new versions of iOS/iPadOS. This limitation cannot be bypassed; these are 32-bit architecture devices, whilst all recent versions of iOS/iPadOS are designed for 64-bit hardware platforms. iPad2, iPad3 and iPad mini1 are obsolete.
For information, here is a list of the highest version of iOS supported by the older models of iPad (for simplicity - “generations” are shortened to a number) that are restricted in their ability to be updated:
32-bit devices (obsolete)
iPad1 - iOS 5.1.1
iPad2, iPad3 and iPad mini1 - iOS 9.3.5 (WiFi Only models), iOS 9.3.6 (WiFi+Cellular)
iPad4 - iOS 10.3.3 (WiFi Only), iOS 10.3.4 (WiFi+Cellular)
64-bit devices
iPad Air1*, iPad mini2 and iPad mini3* - iOS 12.5.7
iPad Air2, iPad mini4 - iPadOS 15.8.3
iPad5, iPad Pro (9.7"/12.9" 1st generation)* - iPadOS 16.7.10
iPad6, iPad Pro (10.5"/12.9" 2nd generation) - iPadOS 17.7.3
(*) obsolete
Newer models are all able to be updated to the current version - iPadOS 18.2.1
- iPad Pro 13" (M4)
- iPad Pro 12.9" (3rd generation and later)
- iPad Pro 11" (1st generation and later + M4)
- iPad Air (3rd generation and later + M2)
- iPad (7th generation and later)
- iPad mini (5th generation and later + A17 Pro)