Sound waves do this in order to transfer the wave
A sound wave is a disturbance that propagates through air or another medium. The disturbance, a vibration, is transmitted via a series of successive compressions and rarefactions (stretching) of the air. This type of wave is called a compression wave. The direction of displacement of air molecules is longitudinal to the direction of travel. In other words, the air is compressed and decompressed in a back and forth motion rather than an up and down motion like a water wave.
Unlike light, which travels through space, sound waves and other mechanical waves require a medium for transmission. Sound doesn't travel in space due to the lack of matter. The speed of sound varies with air temperature because molecules of air are spaced farther apart when they're warmer.