First it's important to remember that a wave isn't an object that is moving. When a wave moves through a substance the particles of the substance move side to side or backwards and forwards around their original place (oscillating), so that when the wave has passed they are back in the spot they started from. There are two types of waves, tranverse and longitudinal.
The picture we usually have of a wave, like a wave on the surface of the sea, is a tranverse wave. In a tranverse wave the particles move perpendicular to the direction of the wave, 'up and down'.
In a longitudinal wave, like sound moving through the air, the particles move in the same direction that the wave does. This means some of the particles are being pushed together (compression), while some are being pulled apart (rarefaction).