check the picture below.
notice, the triangle above is a 30-60-90 triangle, and thus we use the 30-60-90 triangle to find the common side to both triangles, namely y.
once we know what y is, since the bottom triangle is a 45-45-90 triangle, we use the 45-45-90 rule to get x.