Listen to an ambulance or police siren as it passes. You should be able to hear a higher pitch as it is moving toward you and a lower pitch as it moves away. You are hearing the Doppler effect. It works for light as well as sound. The frequency (pitch for sound) and wavelength of both sound and light change if the source is moving relative to the observer. Think of the waves as either being stretched out or squeezed together. Note that either the source or the observer can be moving. When applied to light, the Doppler effect causes light from a source moving away to be shifted to a longer wavelength and light from an incoming source to be shifted to a shorter wavelength. Because red light has a longer wavelength than blue light, the shift toward a longer wavelength is a redshift.
When applied to astronomy, the Doppler effect is the only way that we can know if a celestial object is moving along our line of sight either toward or away from us. Light from an object moving toward us is blueshifted, and from an object moving away is redshifted. The amount of either blue or red shift tells us how fast the object is moving.