Lay a Slinky out on the floor, hold one end, and jab that end forward once and back. A tight bunch of coils, a compression, runs down the Slinky, followed by a stretched-out region, a rarefaction. Each coil only shuffles a little way forward and back around its resting place, yet the bunching travels the whole length. Sound in air works the same way: a speaker cone moves forward and squeezes the air in front of it to a slightly higher pressure, then moves back and leaves a slightly lower pressure, and that pattern travels outward.
The same wave can be described in two ways: by how far the particles are displaced, or by how far the pressure rises above and falls below normal, Δp. The two descriptions are offset. The pressure is highest where particles from both sides have crowded in, which is exactly where the displacement is zero. One wavelength is the distance from one compression to the next. The changes are small: even a loud rock concert swings the air pressure by about 20 Pa, around 0.02% of atmospheric pressure.
A graph of a pressure wave looks like a transverse wave, with peaks and dips, but it plots Δp against position; it is not a picture of the air, and nothing moves up and down. Because the wave is made of squeezed particles, it needs particles. In the near-vacuum of space there is nothing to compress, so no sound travels, while light, which is not a pressure wave, crosses empty space easily.
Think of it like this. A pressure wave moves like a shove passing through a packed train carriage: the people by the door are pushed into their neighbours, who bump the next row, and a wave of crowding runs down the carriage while each person rocks only a step forward and back. In an empty carriage there is no one to pass the shove on, just as sound cannot cross a vacuum.
Core idea. Sound and similar waves travel as a moving pattern of squeezed and stretched regions in a medium; the particles only shuffle back and forth along the direction of travel, so the wave cannot exist without matter to squeeze.