How do I find PostgreSQL's data directory?
If you can connect to the database with superuser access, then

SHOW data_directory;


is the shortest way.

If the server is not running and you forgot where the data directory was, then you really have to guess yourself.  An operating system specific convention or the shell history might provide hints.