The easiest and probably the correct way to reset the Magento administrative password is to use the command line:
As you noticed, you need to install the n98-magerun2 utility, since there is no password reset command in the standard Magento command set (php bin/magento).
In addition to the password, you may also need to reset two-factor authentication:
n98-magerun2 security:tfa:reset <username> google
If you have access to the Magento admin panel and need to reset the password for someone else, you can do it right from the panel.