You need to specify the correct port for your installed server instance. psql -h <Host> -p <Port>
can be used to specify the TCP endpoint for your desired server. If you have 2 servers running then they must differ in the configured port.
If your -h
Parameter starts with a slash it will not use TCP but assume you have specified the name of a local unix domain socket (which only works on the DB machine and not under Windows. I think by default the path includes the port number as well)
There are also environment variables which can be used instead or via .pg_service.conf.
See https://www.postgresql.org/docs/current/app-psql.html „Connecting to a Database“.