You need to use it when both the receiver and the sender are moving.
(wavelength) = (frequency) / (speed of signal)
Apply this equation to both the sender and receiver, setting wavelength of the signal at each equal to each other.
(wavelength sender) = (wavelength receiver)
Therefore:
(frequency sender) / (speed of signal +/- speed of sender) = (frequency receiver) / (speed of signal +/- speed of receiver)
Rearrange for (frequency receiver):
(frequency receiver) = (speed of signal +/- speed of receiver) * (frequency sender) / (speed of signal +/- speed of sender)
Determine whether to add or subtract the speed of sender/receiver by realizing that if the sender is approaching the receiver then the frequency received must have increased. This indicates that you must subtract the speed of sender from speed of signal. If the receiver is moving toward the sender, then the frequency received must have increased. This indicates you must add the speed of receiver to the speed of signal.
So basically just memorize the first equation, set them equal and logically think through how speed affects the signal speed to give you the right change in speed.