The sound is produced when something vibrates. The vibrating body causes the medium (water, air, etc.) around it to vibrate. Vibrations in the air are called traveling longitudinal waves, which we can hear. Sound waves consist of areas of high and low-pressure
called compressions and rarefactions, respectively.