Parallax
An isosceles triangle is determined by the length of the base and the opposite angle.
If the base is fixed, the height (or distance) can be found by measuring the angle. In this geometric sense, the top angle is called the parallax.
Heliocentric Parallax
The most common method of parallax to measure distance to stars is the heliocentric parallax, where we use the distance from Earth to the Sun as the base of the parallax triangle. Take a photo of the night sky in two different seasons, about half a year apart. The orbit of the earth around the sun is used as the base.
Nearby stars appear to move more than stars further away. The baseline can be up to 2 AU.
The green star is closest because it has the largest parallactic shift.
The blue star is further away, but still a lot closer than the red background stars, who do not appear to have any shift at all.
The animation below shows how parallax affects our perception of the apparent position of a star near to us in the course of a year. It's position relative to other, farther away stars seems to change because our viewing position shifts as the earth moves around the sun.

Drag the slider on the illustration to learn how we can deduce the distance to a star
by measuring the stellar parallax value.
Calculating astronomical parallax
The angles involved are very small, typically less than 1 arc second. (Remember that 1 arc second = 1/3600 of a degree). To determine the distance to a star we can write (for small angles):
d = b / 2p = ½ b / p
where d is the distance to the star, p is the parallax angle expressed in radians (see diagram), and b is the baseline. In the case of heliocentric parallax, the base b is equal to 2 Astronomical Unit (AU)  the diameter of the Earth's orbit.
Since there are 206,265 arc seconds per radian, the formula can be rewritten as:
d (in AU) = 206,265 / p
with p now measured in arc seconds.
Or, if we write the distance of one parsec as 206,265 AU, we get:
d (in parsecs) = 1 / p (in arc seconds)
Thus one parsec is the distance for which the heliocentric parallax is 1 arcsecond.
This is the distance unit astronomers use most frequently, and it is equivalent to 3.26 light years.
This unit was chosen because it makes the parallactic formula very simple.