Try this:
Open PgAdmin -> Files -> Open pgpass.conf
You would get the path of pgpass.conf at the bottom of the window.
Go to that location and open this file, you can find your password there.
Reference
If the above does not work, you may consider trying this:
- Edit
pg_hba.confto allow trust authorization temporarily - Reload the config file (
pg_ctl reload) - Connect and issue
ALTER ROLE / PASSWORDto set the new password - Edit
pg_hba.confagain and restore the previous settings - Reload the config file again