If you look at the diagram, you'll realize that the angle on the right is a right angle.
Because there's three angles in this line (angles in a line add up to 180 degrees), we know that the remaining angles must equal 90, since 180-90 = 90.
We can now create an equation with what we know:
5x + x + 54 = 90
6x = 36
x = 6
Let me know if you need me to explain anything I did here.
-T.B.