To restore the password for the root account, run YouTrack with the -Djetbrains.charisma.restoreRootPassword=true JVM option. For example:
java -Djetbrains.charisma.restoreRootPassword=true -jar youtrack-2021.1.10244.jar 8080
When YouTrack starts, the root user password and permissions are reset to their default values. You can then log in with the default credentials (root/root) and set a new password for the account.
The exact procedure for restoring the root account varies by installation type. For details, see Change or Restore Password and Permissions for Root.