The difference between transverse and longitudinal waves is the direction the medium of the wave moves in relation to the direction of wave propagation. In transverse waves, the medium is displaced perpendicular to the direction of the wave. In longitudinal waves, the medium is displaced parallel to the direction of the wave.
A wave on a string is the classic example of a transverse wave. Each part of the string moves up and down while the wave moves from side to side. Transverse waves can not happen in gases because the perpendicular motion is not created by any force.
A Slinky is a great way to visualize longitudinal waves. Each part of the Slinky moves from side to side, just like the wave itself.
Sound waves are longitudinal pressure waves in the air. Water waves involve a combination of transverse and longitudinal waves. The water moves up and down, but also back and forth. Each particle in the water ends up moving in a circular fashion. Earthquakes also have different kinds of waves. The primary waves, called P waves, move with the highest velocity and are transverse waves. Secondary waves, called S waves, are longitudinal waves and occur seconds after the primary waves.