To erase the iPhone for “forgot the Screen Time | Restrictions passcode “, you can reset it with the following methods:
Method 1: Erase the iPhone with iCloud
You can wipe all personal data and settings from the iPhone and reset the iPhone with Find My iPhone erase function. But the Find My iPhone should be enabled before you go to iCloud. See Apple official tutorial: https://support.apple.com/en-euro/guide/...
Method 2: Reset iPhone via iTunes
iTunes can be a powerful tool for you to reset the iPhone no matter you forgot the iPhone passcode, screen time|restirction passcode or Apple ID passcode. It can help you to do a factory restore, which erases the information and settings on your iPhone and installs the latest version of iOS. After that, the iPhone is set as the new one.
Method 3: Remove the iOS 12 Screen Time Password without Data Loss
For the iOS 12 users, they can benefit from iPhone Passcode Genius as this tool can help to delete the screen time passcode if they forgot the screen time|restriction passcode. They do not need to reset the iPhone and lose all the data and settings. You can check this article to have a view.
For the iPhone reset by iCloud and iTunes, the iPhone users can set the restore the iPhone from backup if they did make one. In this way, they can minimize data loss.