In this question you are looking at a straight line. The sum of a straight line is 180 degrees. To work out the measurements of each angle you need to work out what x is first.
This means that from your diagram:
(5x-30)+2x = 180
From here you get rid of the brackets
5x - 30 + 2x = 180
Because both the 30 and 180 are measured in degrees, you can move the 30 to the other side.