I Forgot My Restrictions / Screen Time Passcode!
If this is not the first time you are setting up a passcode, and you are being asked to enter a passcode for Screen Time, you or someone else who used the device had setup the passcode already. You can try to remember or get the passcode somehow. If not, please refer to this article on Apple's support website to reset the passcode.
If you have an older version of iOS (12 and under), unfortunately, you do not have the option to reset your passcode. You need to restore your device to Factory Settings. Follow the instructions in this article to restore the device. Once you have setup the device as a new one (please do not restore a backup as the Screen Time passcode may be backed up), you can then sync it back with your iTunes account and all your music, apps, contacts and any other content sync'ed with iTunes will be loaded on the device. Any content that is stored only on the device and not sync'ed with iTunes, like app logins or data, will be lost during this process. Be forewarned that this is a long process and can take a couple of hours or more to complete. This can be painful, but it is necessarily so to prevent users from working around the security settings. After the restore is complete, you can setup a new Restrictions passcode. Your children might also be looking for some screen time passcode hacks on the internet, it’s best to get to know them to stay a step ahead.
Please make a note of the passcode to avoid this situation in future.