One method involves finding a cepheid variable in the vicinity of the star, or even in the galaxy you are investigating. These stars vary in brightness with a period closely related to their absolute magnitude. By measuring the period, you can know how bright it would appear at a distance of, say, one light year. Using a photometer, you can measure it's apparent magnitude, and figure out how far away it must be for you to see it as you do.
From the referenced web page:
In 1924 Edwin Hubble detected Cepheids in the Andromeda nebula, M31
and the Triangulum nebula M33. Using these he determined that their
distances were 900,000 and 850,000 light years respectively. He thus
established conclusively that these "spiral nebulae" were in fact
other galaxies and not part of our Milky Way. This was a momentous
discovery and dramatically expanded the scale of he known Universe
For another Method, imagine this:
Look carefully at Sirius with your naked eye tonight. Tomorrow, take a piece of brass with small holes a varying size, and see which one, when held up to the sun, seems as bright as Sirius. Knowing the area of that hole, knowing what fraction of the area of the sun's disk you could see through that hole, and assuming the sun is a star just like Sirius, you now know how bright the sun would be if it were as far away as Sirius, and you can make an educated guess how far Sirius is from the Earth.
If it's around 1650, you're Christiaan Huygens, and you assume all stars are the same, then you've made a massive contribution to our understanding of the universe. However, since the Sirius puts out something like 25 times as much light as the sun, Huygens answer was only some 30,000AU, an epic underestimate. Still, the first scientific evidence hinting at the true size of our universe.