Imagine that you've got a speaker in the middle of the room. As you know, sound is a pressure wave and like all waves, it has a wavelength, frequency and velocity.
So let's do some basic calculations. The speed of sound in air is about 340m/s and let's say that this speaker is playing a note at 1Hz (which would be too low to hear, but we'll use that to simplify calculations). We know that
v=fλ so
λ=fv. The wavelength is therefore
1340 = 340 m. You can intuitively understand this. The speaker drum is vibrating at 1Hz so it sends out one pressure pulse per second. This means that between the first pulse and the second pulse, the first pulse has travelled for one second = 340m before the second pulse is made.
Now, we're going to start moving the speaker. Specifically, we're going to start moving the speaker at a constant speed of 10m/s, directly away from us. The speaker drum goes up, and a pressure wave is made, that travels towards us at the speed of sound, i.e. 340m/s. The frequency of the drum has not changed so one second later, the second pressure wave is made. However, remember that this time, the sound source has been moving away from us. So whilst the first pressure wave has moved 340m away from the
original location of the speaker, the speaker is now 10m further away. So the second pressure wave is 340+10m = 350m from the first, so rather than experiencing a sound wave with a wavelength of 340m, you experience a sound wave with a wavelength of 350m. Plugging this into our
v=fλ formula, we find that the new frequency is 0.97Hz, i.e. slightly lower than the sound you heard when the speaker was at rest. So if you imagine that you could hear it, it would have a lower pitch.
You can repeat the same experiment, this time imagining that the speaker is moving towards you. This time, the separation between wavefronts will be 340m-10m = 330m, so the frequency you would hear is 1.03Hz.
That's the basic principle. A source emitting waves at a constant frequency has its frequency shifted up (and its wavelength shifted down) when it is moving towards you, and its frequency shifted down (and its wavelength shifted down) when it is moving away from you. This principle applies to all waves, e.g. electromagnetic radiation, not just sound waves.
Does that help?