$ ping <server>
If the ping is unsuccessful, check the firewall settings on your local computer and your network's router to make sure that outbound traffic to the port in question is allowed. If the firewall rules permit traffic to your destination port, but the ping still fails, check that ICMP traffic is allowed through. Blocked ICMP traffic will cause all pings to fail.
If your ping is successful, you will then want to check if there exists any excessive network delays. You can check this with traceroute.$ traceroute <server>
The results of this command will show how long it takes for your packets to reach your server at each hop they take. Network issues can cause delays that can then lead to your client timing out. If network delays are not the issue, then further insight may be gained from connecting to the service using a native client and taking note of any error reported.