See this article. How to use parental controls on your child's iPhone, iPad, and iPod touch - Apple Support
Note the part which says: 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.