The first step requires identifying the lines at their ``rest'' wavelength:
The lines we expect from, say Hydrogen, will NOT be in their normal place if the star is moving quickly. However, ALL the lines move with the same relative shift:
If we can identify a specific relative pattern, like in this example, we see two close lines, separated by a third isolated line, this allows us to identify WHICH lines we are seeing.
By measuring the exact wavelength the lines are seen at, and comparing that with what we know the rest wavelength (stationary wavelength) is, we determine the relative velocity of a star.
A final important point to remember: You can only measure a Doppler Effect for relative motion along your line of site. This is called the radial velocity. If an object is moving perpendicular instead of towards you, then they have zero velocity away or towards you. You would measure NO shift, even though the object may be moving very quickly. In astronomy, things rarely are moving entirely towards or away from us. So we must realize that the component of motion measured in the Doppler Shift, the radial velocity, likely represents only a fraction of the real space velocity of the source.