First you want to get all the gs on one side of the equation.
I added 9 to both sides and subtracted 2g from both sides and got
12=3g
Then just divide each side by 3, and get
g=4