Probably the oldest technique of an astronomer to measure the distance to the stars is trigonometric parallax. Parallax can be used to measure the distance to any object, and was first employed by travelers to measure the distance to mountain ranges, and estimate the heights of mountains. In the case of measuring the distance to a mountain, one measures the apparent angular position of the peak, walks some known distance perpendicular to the direction of the mountain forming the base of the triangle, then measures the angular position again. From the change in angular measurements and knowing how far they walked, simple trigonometry solves for the distance of the mountain.
Same is true for measuring distances to stars, except instead of walking a known distance, astronomers wait 6 months for the earth to move in position 2 AU, and then measure the second position of the star in the sky. The difference for measuring stellar distances however is that the triangles involved have extremely small angles. Beyond trigonometric parallax, astronomers can measure distances based off other techniques that involve analysis of the light from the star, but parallax by far is the most reliable. Thus, these other methods can be used in modern astrophysics to look further than parallax can measure precisely, but its crucial that these be calibrated with known distances measured by parallax.
Hubble uses a new technique called spatial scanning to improve its ability to measure arc seconds (1/3600th of a degree) so that it can now measure distances as far as 7,500 light years, rather than the 750 light years it was capable of before. They used this new capability to measure the distances to a class of stars called Cepheids that pulsate in brightness at a certain period. Because astronomers know the relationship between period and luminosity, the brightness can be calculated and the distance can be extrapolated from the flux of light reaching earth. Hubble’s new capability hopes to analyze our current accuracy with measuring distances with cepheids and type 1a supernova to get a more accurate map of the cosmos.
Sources:
http://www.sciencedaily.com/releases/2014/04/140411091943.htm
Modern Astrophysics 2nd edition by Caroll Ostlie