In the terminal, type the following

sudo su postgres
psql
\password

It should prompt to enter your new credentials.

And that’s it. You’re done.

To exit from the psql shell.

\q