Sound is classified as a mechanical wave because it requires a medium to propagate its energy and cannot be heard in vacuum.There are two broad classes of waves - mechanical and electromagnetic. One requires a medium to be heard, and the other does not.
Electromagnetic waves do not require a medium to travel in and can propagate energy through a vacuum by vibrating magnetic and electric fields perpendicular to each other. Light and heat are examples of electromagnetic waves because they can transfer energy through space. Mechanical waves, on the other hand, transfer energy by vibrating the molecules of a medium, which can be either solid, liquid or gas. In the absence of molecules, mechanical waves cannot transfer energy.
If a source of sound, such as a bell, is placed in a jar from which all air has been removed, the sound of the bell cannot be heard when it rings. If the jar is then filled with either air or water, the sound of the bell can be heard. Similarly, a tuning fork works by vibrating the air molecules in its vicinity by moving back and forth and would not produce any sound if the molecules were absent, thus demonstrating that sound is a mechanical wave.