xxxxxxxxxx
The \dp backslash-command in psql is the obvious starting point.
https://www.postgresql.org/docs/current/app-psql.html
If you start it with -E it will show you the queries it runs for the backslash commands.
Other than that you can dig into pg_roles and similar in the system tables.
https://www.postgresql.org/docs/current/catalogs.html