In order to calculate how far away a star is, astronomers use a method called parallax. Because of the Earth's revolution about the sun, near stars seem to shift their position against the farther stars. This is called parallax shift. By observing the distance of the shift and knowing the diameter of the Earth's orbit, astronomers are able to calculate the parallax angle across the sky.
The smaller the parallax shift, the farther away from earth the star is. This method is only accurate for stars within a few hundred light-years of Earth. When the stars are very far away, the parallax shift is too small to measure.
Your vote on this answer has already been received
It is by LIGHT YEARS AWAY.Is a unit of length, equal to just under 10 trillion kilometres (1016 metres, 10 petametres or about 6 trillion miles). As defined by the International Astronomical Union (IAU), a light-year is the distance that light travels in a vacuum in one Julian year.