As discussed on the Measurements page, astronomical distances cannot be measured in terms we use for earth measurements, such as inches, feet, meters, miles, kilometers, etc. We have got to use terms which mean much larger distances, such as "Astronomical Unit" (or AU), which is the distance from the Earth to the Sun, or "Light Year" (or LY), which is the distance light can travel in one year at its present speed: one light year is 5.87849981 × 1012 miles. or about 5,880,000,000,000 miles. We are 28,000 light years away from the center of our own galaxy. THAT is why we speak in terms of light years and not miles. A parsec is a distance of 3.26 light years.
Historically, the first method of measuring astronomical distances was done by means of something called "parallax." Look at something close to you, like a tree in your yard, and then look beyond it, at a distant tree, or some mountains or tall buildings. Now change your position. The tree you were looking at close to you is in a very different position compared to the distant object. The amount of your movement is your mathematical base line. This works the same way with stars. The base line is the width of the earth's orbit around the sun. From any given date to six months later, that distance is known. Then all that has to be measured is the angle from the center of the base line to the outer line of sight to find the exact distance.
An animated diagram can help to understand this. Below is another illustration:
The closer the object is, the larger the parallax angle will be, and this is how objects in space up to about 1650 light years can be accurately measured to find their distance from Earth. The distance from the Earth to the sun was first measured accurately by Cassini in 1672. He used the parallax of Mars to do this. The distance from the sun to the Earth is half the diameter of the Earth's orbit. This was later to be used as the base line to judge the distances to stars. The first accurate astronomical measurements done this way were in 1838 by Bessel.
Now for a little math. A circle is made of 360 degrees. Each of those degrees can be divided into 60 parts called "miinutes" and each of those minutes can be divided up into 60 parts called "seconds." We use these terms in space as well as with our clocks.One second of arc, is then 1.296 millionths of a circle. Astronomically we can measure angles this small.
Now, if we are measuring parallax out far enough so that the angle we are working with is just one second of arc (one arcsecond), it has been found that the line going out to that angle is 3.26 light years long. That distance of 3.26 light years thus has come to be known as a "parsec."
Within the distances we can accurately measure with parallax are stars called cepheid variables. As explained in The Stars, we can accurately measure distances with these stars as well. However, because these stars are found in other galaxies, we can measure distances much farther with them than by means of parallax. The link given explains how that is done. Cepheid variable measurements of distance can take us out to about 135 million light years. The RR Lyrae variable stars are valuable as back-up measurements to confirm the cepheid variable measurements.
Within our Local Group of galaxies, there have been a number of supernovae. Certain types of these exploding stars have a distinctive light curve which have a standard brightness, or luminosity. This allows them to be used as distance markers. Because they are intensely bright (sometimes brighter than a hundred million normal stars), they can be seen at very extreme distances, to the frontiers of the universe. Cepheids have allowed us to measure the distances to these supernovae in local galaxies, so we know the correlation between distance and brightness.
We have seen that there is a correlation between the distances given by Cepheid Variables and Supernovae and the red shifting of light from distant galaxies. From this information we can work out the red shift/distance curve used by astronomers today.
(note: "Mpc" means "megaparsec" or a million parsecs. "Z" on the vertical axis are the red shift measurements)
So while there is an argument over what the increased redshift means the farther we go out (as explained in the red shift link above), the fact that the redshift can tell us distance is not in dispute.