Sound waves are vibrations, and as we have seen, cannot travel through a vacuum - the total absence of matter. The more matter there is, and the closer atoms are together, the easier it is for sound can travel.
In air, which is a mixture of gases, the speed of sound is around 340 m/s, depending on air temperature. For water the molecules are much closer together, so vibrations pass much more quickly between them. As a result sound can travel at around 1500 m/s - over 4× faster!
In solids, where atoms are really close together, and very tightly attached to each other, the speed of sound is even higher - typically 5000 m/s.