iPad 2nd gen tops out at iOS 9.3.6, and won’t be useful. iOS 18 and iPadOS 18 are current. ~Nine years newer, too.
You might still be able to reset it to factory using a Mac or PC.
If you forgot your iPad passcode, use your Mac or PC to reset it - Apple Support
You won’t be able to use apps or services past what are installed, and you’ll have trouble making network connections to an ever-increasing number of websites. The app store will be inaccessible, as well. And this iPad is 32-bit, further limiting what apps can available.
You also won’t be able to restore a backup from a newer iOS or iPadOS version to iOS 9. Backups can go from same to same, or older to newer. Not newer to older.
Apple will recycle it for free in most places.