# How do we determine both the distance to and speed of distant stars?

My understanding is that we can measure the distance to far away stars by using their color to infer the absolute magnitude of the light they emit and compare that to the observed magnitude of the light we actually receive. The difference between those values tells us how far away the star is. From my amateur perspective, this makes sense, even if I don't know the exact equation that describes the relationship.

For speed away from us, I've been told that we measure the redshift of the light. However this presents two issues to me.

1) How is the redshift actually measured? I haven't found any website that attempts to explain this. I understand the math and the Doppler effect, so I get the relationship, but I don't see how we get the z value in the first place.

2) Doesn't this mess up the distance calculation? If the light is redshifted, then the color would be different, so in order to get the distance from Earth, we'd first have to "de-shift" the light once we know what it is, right?

I'm asking about both because they are related topics and I want to make sure a misconception on distance isn't confusing me about speed. If someone could clear up both for me, I would appreciate it.