Ancient astronomers thought that all the stars were positioned at the same distance from the Earth in a large hollow sphere. After telescopes were invented, astronomers started measuring the distance to the stars with a method called stellar parallax .
To use stellar parallax, one needs to measure the position of a star with respect to the background of stars, at an interval of six months (because six months is the largest distance we will get between two positions of the Earth in its orbit around the Sun).