Refer to steps here:
What to do before selling or giving away your iPhone, iPad, or iPod touch "Use these steps to remove your personal information from a device, even if you don't have it anymore." Click here --> https://support.apple.com/HT201351
If you're enoucntering a specific issue it heps to be very descriptive of the problem. In what way won't it let you? What error messages (exact wording)?
Maybe this? --> If an app or feature on your device is not working, it may have been disabled using Screen Time, or by an IT administrator if you are using a device owned by an employer or educational institution. See how to 'Use Screen Time on an iPhone, iPad, or iPod touch' by clicking here --> https://support.apple.com/HT208982