Note that, in following lines, you have first entered into postgres user't terminal (Of your OS) root
Then by using psql
command, you have entered into the postgres DB user's shell
[mainul35@localhost ~]$ sudo su postgres
bash-5.0$ psql
could not change directory to "/home/mainul35": Permission denied
psql (11.7)
Type "help" for help.