Parallax is one of the most important distance measurement methods used by astronomers. It can only be used for nearby stars, but it is very accurate.
The method works by measuring at the apparent movement of a nearby object against the background of a distant object. Can you see how the movement of the photographer makes the nearby lamppost appear to move relative to the distant tower?
You can see this effect by stretching out your arm and raising a pencil. Now close one eye and move your head from side to side. See how the pencil appears to move in relation to the wall behind it.
By measuring the angle labelled p on the diagram, we can use our orbital distance from the Sun and a little trigonometry to calculate the distance to the nearby star. However, even for the nearest stars, the angle is very small - usually only a fraction of an arcsecond - but if you are very careful, you can measure the distance to stars several hundred light-years away.