How the distance of distant stars and planets are measured?
For planets, their distance can be easily calculated from deriving their orbits from Kepler’s third law, relative to Earth’s orbit. For stars, there are many, many methods of estimating distance; the most common one is parallax, but for now it only works for relatively nearby stars. For farther stars, we have to rely on cruder techniques like spectroscopic parallax, which involves matching a star’s brightness from Earth with the brightness it should be based on the H-R diagram.