Hi Arielle,
here are the steps:
Step 1
Mg + O2 → MgO
notice that there 2 oxygen atoms in O2 on the left, but only 1 oxygen atom in MgO on the right. To balance oxygen, let us put 2 in front of MgO
Mg + O2 → 2 MgO
Step 2:
Mg + O2 → 2 MgO
Now that oxygen is balanced, let us take a look at magnesium. There is one magnesium atom on the left, while there are two magnesium atoms on the right. To balance magnesium we need to put 2 in front of Mg on the left.
2 Mg + O2 → 2 MgO
Our reaction equation is now balanced.