This makes clear why a long-standing effort has been to find a relatively common astronomical species whose intrinsic brightness can be reliably determined without the need to stand right next to it. If you could find such so-called standard candles, you’d have a uniform benchmark for judging distances. The degree to which one standard candle appeared dimmer than another would tell you directly how much farther away it is.
But this doesn't take into account the possibility of items in between, filtering or deflecting the light in some way.