If you can’t update your device, delete it and set it up as new to remove the passcode and choose a new one. If you forgot your Screen Time passcode, update your device to the latest iOS or iPadOS then reset your passcode. Then tap Change Screen Time Passcode or Turn Off Screen Time Passcode, and authenticate the change with Face ID, Touch ID or your device passcode. To change or turn off the passcode on your child's device, tap Settings > Screen Time >. Make sure that you choose a passcode that's different from the passcode you use to unlock your device. If asked, enter your passcode, then turn on Content & Privacy. This can be used to reset your Screen Time passcode if you forget it.
In iOS 13.4 and later, after you confirm your passcode you'll be asked to enter your Apple ID and password.