$$Mg(NO_3)_2 \rightarrow MgO + NO_2 + O_2$$
To balance the equation, we need to make sure that the number of atoms of each element is the same on both sides of the equation.
We start by balancing the number of nitrogen atoms. There are two nitrogen atoms on the left side of the equation, and one nitrogen atom on the right side. To balance this, we need to add a coefficient of 2 in front of the $NO_2$ molecule:
$$Mg(NO_3)_2 \rightarrow MgO + 2NO_2 + O_2$$
Now, we balance the number of oxygen atoms. There are six oxygen atoms on the left side of the equation, and five oxygen atoms on the right side. To balance this, we need to add a coefficient of 2 in front of the $O_2$ molecule:
$$Mg(NO_3)_2 \rightarrow MgO + 2NO_2 + 2O_2$$
Finally, we balance the number of magnesium atoms. There is one magnesium atom on the left side of the equation, and one magnesium atom on the right side. The equation is now balanced:
$$Mg(NO_3)_2 \rightarrow MgO + 2NO_2 + 2O_2$$