Hello. Are the steps available here not working as expected for you? Are you unable to reset your Screen Time passcode using your Apple ID?
If you cannot remember your Screen Time passcode, you should be able to restore your iPhone using the steps in the article here if you have access to a Mac or PC. This will delete all of your data. You should not need your Screen Time passcode to restore your iPhone using Recovery Mode.
Lastly, if you are planning on selling or giving away your old iPhone, please be sure to follow the steps here and sign out of iCloud to avoid having the device be iCloud locked for its new owner.