Since a triangle has 180 degrees, you can set up an equation, 180 = 40 + (2x - 30) + (x + 20). You solve for x first, which gets, x = 50. Then since the question is asking for the angle of B, you plug x into (2x - 30) and solve. This gets us 70 degrees for angle B.
I’ve shown the steps with more detail in the image below.