Purchasing a used device from anywhere other than Apple is fraught with risk - but assuming that the device was correctly prepared for reuse prior to its resale - we need to establish what is locked/disabled and move from there.
If you device is disabled because you have either forgotten or successively entered the incorrect passcode, you’ll need to follow this procedure:
https://support.apple.com/en-gb/HT204306
However, if your iPad is indicating that it is Activation Locked and you have forgotten your AppleID or password, you’ll need to recover them:
https://iforgot.apple.com
Recovery of AppleID:
https://support.apple.com/en-us/HT201354
Recovery of the AppleID password:
https://support.apple.com/en-us/HT201487
More information about Activation Lock and associated procedures can be found here:
https://support.apple.com/en-us/HT201365
If, by chance, the iPad was not prepared correctly prior to resale to you - and the AppleID corresponding to the Activation Lock is not yours AppleID, then you’ll need to secure the cooperation of the previous owner - as only they will be able to release the Activation Lock. In this circumstance, if the previous owner cannot be contacted, it’s “game-over” as there is no way to bypass the lock.
This article may be of interest:
https://discussions.apple.com/docs/DOC-250001038