
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.
The same effect can be measured as the Earth orbits around the Sun.
Take a look at the following diagram: