The goal of the equation is to isolate x. In order to do that we have to remove the '-2' by doing the inverse operation. That is the opposite operation, for example addition and subtraction, multiplication and division.
Since x is being multiplied by -2, we do the inverse which is division.
You spent 9 dollars. why? because your neighbor spent 3 times more than you, which means you spent 1/3 of what he spent. so just multiply by 1/3 to get 9.