How does parallax work?
It works because during those six months the Earth has moved 180 degrees along its orbit and is now in a different position. As a result of this, we now observe the star from a slightly different angle which makes the star appear to be in a slightly different position compared to the more distant background stars. The situation is analogous to reading the speedo in a car. Since the needle is in front of the dial you can get a range of apparent readings. Directly in front of the speedo you get the correct reading. If you read is from the left you will systematically get a higher than true reading, and a lower than true reading if you read it from the right. Parallax exploits this illusion to derive an angular change in the apparent position of the star. Since the length of one side of the triangle is already known (it is 2 AU), we can work out the distance to the star with simple trig.