If you forgot the Apple ID password, enter the Apple (iCloud) ID, and click Forgot Password. See if you can get a Rescue or Notification email option if necessary. Link to contact Apple Support at the end of the 2nd article.
Apple ID - Manage -
Apple ID – Forgot Password *
The following will erase the iPad. If necessary, if you are the original owner, contact Apple. Apple can remove the ID if provided the required paperwork to include the original purchase receipt with the serial number on it.
Request additional support for unlocking your device. -
You used to be able to take the device, the original purchase receipt with the serial number, and a photo ID to the nearest Apple Store (if it has reopened) and have them remove the ID. This may have changed, so call the store before going to make sure they can help.
Genius Bar Reservation and Apple Support Options - Apple.
If you recover the password, when changing to the new ID, there may be some data loss, but you can minimize it. If syncing photos with iCloud, ensure Optimization is turned off in Settings/Your Name/iCloud/Photos and/or in Photos/Preferences/iCloud. Then make sure full resolution photos are on the device/computer. When signing out of iCloud, if asked whether you want to retain data, choose yes. Messages conversations will be lost if they are addressed to the ID. See the article below for other places that the old ID should be removed. See Winston Churchill's response in the below discussion. If possible, also set up Family Sharing between the IDs to keep access to your apps/purchases.
How to switch Apple IDs on your iPhone or iPad.
How to transfer all files from one iCloud account to another.
What to do after you change your Apple ID or password - Apple Support.
Family Sharing.
Family Sharing - Set up.