OPTICAL REDSHIFT
Before we can go into the use of Redshift to find distance, let us explain the term Redshift as a measure of velocity. This relates to the Doppler effect.
It is a daily experience for all of us to hear the effect of the changing of wavelength and frequency of sound waves when the source is moving with respect to the observer. This is called the Doppler effect, named after Christian Doppler, who formulated this principle in 1842.
Imagine for instance that you are standing on the side of a race track and you hear a race car coming towards you and then passing by. The sound you hear distinctly changes its frequency when the car passes you. When the car approaches, it has a relatively high frequency and when it passes, the pitch becomes lower. Only at the precise moment that the car is right in front of you (no relative velocity between the car and yourself) you hear the true frequency of the sound of the car.
The Doppler effect is caused by the fact that, while waves travel at a certain speed, due to the relative motion the number of waves that reach the observer per second changes, hence the apparent frequency changes.
The doppler effect allows us to calculate radial velocity, i.e. velocity along the line of sight, of a source with respect to the observer, from the change in received frequency. When the source moves towards us we measure a higher frequency (shorter wavelength) and when the source moves away we hear a lower frequency or (longer wavelength).
Check out this multimedia tutorial of the School of Physics, UNSW.