There are some physics principles in astronomy that are so widely used that they deserve a special explanation, and the Doppler effect is one of them.  By taking advantage of this physical law, astronomers have measured:

1. The small forward-and-back motions of stars, which can be used to detect planets;
2. The motions of stars in nearby galaxies, which were used to discover dark matter;
3. The speeds with which nearby and distant galaxies appear to recede from us*, which led to the discovery that the universe is expanding;
4. The speeds with which distant and very distant supernovae appear to recede from us*, which led to the discovery that the expansion of the universe is accelerating (and the only discovery on this list to win a Nobel Prize so far).

So what is the Doppler effect?  The Doppler effect describes how wave patterns are distorted when the object emitting the waves is moving.  When a source that is generating waves moves toward us, the waves of light are compressed.  This is because from our point of view, the source is catching up with the already emitted waves a little bit.  Equivalently, when a source moves away from us, the waves are stretched because the source is moving away from the already emitted waves.  You can see this in the waves around a swimming swan.  You can see gorgeous animations and derivations of the Doppler effect here.

The Doppler effect also exists in sound waves and light waves.  You can hear the Doppler effect when a siren passes you (the pitch of the siren is higher when it is approaching you than when it is receding).  With sound, the frequency of the wave corresponds to the pitch you hear, but with light, the frequency of the wave corresponds to the color of light.  Light can be split into its component colors (wavelengths) with a technique called spectroscopy.  High-frequency light waves (short wavelengths) are blue, whereas low-frequency light waves (long wavelengths) are red.  An illustration of the Doppler Effect is given below.

The description above is what we call the non-relativistic Doppler effect, and it only applies when the relative speed between the object and the observer is small compared to the speed of light.  So in astronomy, do we need to use the slightly more complicated version of the Doppler effect that describes things moving near the speed of light?  It depends on the object.  Stars and planets are not usually moving fast enough for us to notice relativistic effects.  At its orbital speed of 30 km/s, Earth is slow compared to the speed of light (300,000 km/s).  Even close-in planets, which can orbit their stars at 200 km/s, are too slow for the relativistic part of the Doppler effect to matter much in spectroscopy.

*Since these motions are apparent and are better described as due to the expanding fabric of space-time than the motions of individual objects, these are not true Doppler shifts.  The amount of redshift measured corresponds to the time-averaged rate of the expansion of space since the light was emitted, rather than the instantaneous rate of recession of the object.  Maybe I’ll write a cosmology blogpost about how the expansion of the universe messes with our notions of distance, speed, and time someday.  The point is that Hubble measured the redshifts of galaxies because he was trying to measure their motion as revealed through the Doppler effect.  So the fact that the expansion of space also creates a redshift was discovered while trying to use the Doppler effect, which is why I feel okay attributing the two cosmological discoveries above to the Doppler effect!  Also, from the perspective of an observer who uses a spectrometer to measure redshifts and then decipher their meaning, the measurement technique is identical, even though the cosmological interpretation requires more finesse.