I have recently created an account on pgAdmin 4 as part of a university course. After making a server with this account and password, I then went to reopen this server a few days later only to realise I needed my password which I have sadly forgotten.
If you forgot the pgAdmin password, then the Forgot Password link is there on the login page.
If you forgot your PostgreSQL password, then as mentioned by you, find the pg_hba file and do appropriate changes to login without password, you will find many blogs/videos for that.
I have looked online for help, but I am unable to find the mentioned 'pg_hba' file that I need. For reference I am working on Mac.
Is there any other way I can reset this password and gain access to the server? I have also tried uninstalling the application but this has not solved the issue and when reinstalled it is still attached to my account/password.