It is useful to start by drawing a picture to visualize this problem.
In this case we are going to use the trigonometric function cosine, which is Cos(theta) = adjacent / hypotenuse.
Cos(55) = 40 / x
After simplifying we reach the equation: X = 40 / cos(55)
which would then make the length of the wire 69.7 meters long.