In short: Ping and traceroute are the two basic commands for finding out where the problem is when you cannot reach a website or server. ping shows whether the target answers and how long the answer takes. traceroute (tracert on Windows) lists the intermediate points, or hops, that packets pass on the way to the target.

ping sends ICMP ECHO_REQUEST packets to the target and measures the replies. You see whether the target is reachable, how many milliseconds the reply takes and whether packets are lost. traceroute increases the packets' time to live (TTL) one step at a time so that every router on the path answers. On Linux it uses UDP packets by default; tracert on Windows sends ICMP echo requests.
-c. On Windows, ping sends 4 requests by default.ping -c 4 example.com
time= values show the response time and the summary line shows packet loss.An important note: some servers and firewalls do not answer ICMP packets. No reply to ping does not always mean the site is down; check it in the browser too. For the role of the firewall, see our article what is a firewall.
traceroute on Linux and macOS and tracert on Windows:traceroute example.com
tracert example.com
* * * on a line means that router did not answer in time. If later lines still appear, this is usually not a problem; that device simply does not answer this type of packet.traceroute -I or TCP with traceroute -T. These options usually need administrator rights.-m; on Windows, tracert uses /h. If the target is far away you can raise this limit.If the problem continues, copy the ping and traceroute output as text and add the date and time you ran the commands, your own connection (office, home, mobile) and the target address. With this information, a support ticket can be investigated much faster. If the site opens but is slow, the server or application side is more likely than the network; our guide why is my website slow helps with that.
Not always. Some servers and firewalls block ICMP. Try to open the site in a browser and use traceroute to see where the path stops.
The device at that hop did not answer within the wait time. If later hops still appear, this is usually normal.
On Windows the tracert command does the same job. Type tracert followed by the domain name in the command prompt.
It can be, but ping alone does not prove it. Use traceroute to see from which hop the time starts to rise; the increase may start on your own connection.