For security and privacy purpose, Google has removed [Forget password] function to keep your phone under secure and private protection.
Unless you made a backup before you forgot your passcode, there isn't a way to save your device's data. You'll need to take your phone, proof of purchase and warranty card to visit realme Service Center to flash your device, which deletes all of your data and settings.