If you forget your 4 digit Screen Time Passcode
4 Digit Passcode is for Screen Time Restrictions
6 Digit Passcode is for iPhone lock screen
Make sure to choose a passcode that's different from the passcode you use to unlock your device. If you can't remember a restrictions passcode that you set on a previous version of iOS, or you forgot your Screen Time passcode, you need to erase your device, then set it up as a new device to remove the passcode. Restoring your device from a backup won't remove your passcode.
https://support.apple.com/en-in/HT204396
Use Screen Time on your iPhone, iPad, or iPod touch - Apple Support
https://support.apple.com/en-in/HT208982