You have to make sure Postgresql is listening on a suitable IP by setting the listen_addresses option on the postgresql.conf file, many people change the setting to *, meaning all available IP addresses.
Then you have to set the proper inbound rules on the pg_hba.conf file, for example, this rule would accept connections from any IP and any user with password authentication.
host all all 0.0.0.0/0 password
Also, if there is a firewall installed in your system you need to check that it is not blocking incoming traffic on port 5432
Now, if you are self hosting Postgresql at home, you need to check that incoming traffic on port 5432 is being forwarded towars your server's local IP, and if you are hosting on a cloud computing platform like AWS, you need to check your security rules to make sure incoming traffic is allowed on that port.
Sadly, I can't be any more specific since this configurations are very specific to your particular system and also, outside of this forum's scope.