Let's take it piece by piece.
Nine times the difference. Well, times means multiply and difference is the result of subtraction.
The difference of 2 and a number. 2 - n (the difference of a number and 2 would be n - 2)
9(2 - n)
Is means equals. 40 more than twice the number. Twice the number is 2n. 40 more than that is 2n + 40.
9(2 - n) = 2n + 40
Are you supposed to find the number?
18 - 9n = 2n + 40
11n = -22
n = -2