Ident authentication failed for user "postgres"
If you are editing wrong hba file this should fix

Switch to postgres user on OS
run psql
should be connected to PostgreSQL
run show hba_file;
should be seeing to correct hba_file directory and edit that file.
reload postgresql


lloyd@localhost:~$ sudo su - postgres
postgres@localhost:~$ psql
psql (13.1 (Ubuntu 13.1-1.pgdg18.04+1), server 12.5 (Ubuntu
12.5-1.pgdg18.04+1)) Type &quot;help&quot; for help.
postgres=# show hba_file ;

hba_file
/etc/postgresql/12/main/pg_hba.conf (1 row)
postgres=# select pg_reload_conf();

Last query should return true if it's not, there is an error in hba file so PostgreSQL won't refresh hba file. So you should look for error in file. Also you can look at logs. After reloading PostgreSQL, it shows you error with line.