There is a method called Spectroscopic parallax:
Spectroscopic parallax is an astronomical method for measuring the distances to stars. Despite its name, it does not rely on the apparent change in the position of the star. This technique can be applied to any main sequence star for which a spectrum
can be recorded. The method depends on the star being sufficiently
bright to provide a measurable spectrum, which as of 2013 limits its
range to about 10 000 parsecs
There is direct method - astronomical unit:
The astronomical unit is used primarily as a convenient yardstick for measuring distances within the Solar System
or around other stars. However, it is also a fundamental component in
the definition of another critical unit of astronomical length, the parsec.
There is also a method called brightness measurement (simpler explanation of spectroscopic parallax):
There is no direct method currently available to measure the distance to stars farther than 400 light years from Earth, so astronomers instead use brightness measurements. It turns out that a star's color spectrum is a good indication of its actual brightness. The relationship between color and brightness was proven using the several thousand stars close enough to earth to have their distances measured directly. Astronomers can therefore look at a distant star and determine its color spectrum. From the color, they can determine the star's actual brightness. By knowing the actual brightness and comparing it to the apparent brightness seen from Earth (that is, by looking at how dim the star has become once its light reaches Earth), they can determine the distance to the star.
Content will be erased after question is completed.