If you need to input a verification code, but your iPad has an older version of iOS installed with no apparent means to enter a verification code - you should be able to append the generated verification code to the password entering both in the same password input field.
If I have otherwise misinterpreted your question, and your device is Activation Locked, this help page will provide most of the information that you’ll need:
https://support.apple.com/en-us/HT201365
If you have forgotten your AppleID or associated password, these can be recovered here:
https://iforgot.apple.com
To recover your credentials, you’ll need access to one of the following:
- Your primary email address mailbox that corresponds with your AppleID
- Any of the secondary/recovery email addresses that should be configured for your AppleID account
- Any of the trusted telephone numbers (fixed line or Cellular/Mobile) that are associated with your AppleID
Unless you AppleID account has not been fully/correctly configured, or has been seriously neglected, recovery of the AppleID and password should not be difficult.
More information about recovery of your AppleID:
https://support.apple.com/en-us/HT201354
More information about recovery of your AppleID password:
https://support.apple.com/en-us/HT201487
When you recover access to your credentials, you would be well advised to log-in to your AppleID account from a web browser - and verify/update any email addresses and trusted telephone numbers:
https://appleid.apple.com