Edwin Hubble showed that the farther away a galaxy is from the point of observation, the faster it moves away because of the expansion of the universe. The Hubble Law gives the basic conversion factor between the redshift and the distance. Using the current best measurement of the Hubble Constant (the expansion rate of the universe), and adjusting for the geometry of the universe, astronomers simply measure the red-shift of any galaxy and then use the conversion factor to get the distance to that galaxy.