Waves are described by the direction of vibration compared with the direction of travel. In a transverse wave the vibrations are at right angles to the direction of travel. Waves on a rope, ripples on water and light are transverse. Shaking one end of a slinky from side to side makes a transverse wave along it.
In a longitudinal wave the vibrations are parallel to the direction of travel. Pushing and pulling one end of a slinky along its length makes a longitudinal wave. Regions where the coils are squashed together are compressions, and regions where they are spread out are rarefactions. Sound is a longitudinal wave, with compressions and rarefactions in the air.
Both types transfer energy without transferring matter. Each coil of the slinky, or each particle of air, only vibrates about its rest position.