See the following from How to use parental controls on your child's iPhone, iPad, and iPod touch - Apple Support
If you forget your Restrictions passcode, you'll need to erase your child's device, then set it up as a new device to remove the Restrictions passcode. Restoring your child's device using a backup won't remove the Restrictions passcode.
Click on the link in the excerpt above for more detailed instructions.