The balanced chemical reaction would be written as follows:
2Mg + O2 = 2MgO
We are given the amount magnesium to be used in the reaction. This will be the starting point for the calculations. We do as follows:
15.0 g ( 1 mol / 24.31 g ) (2 mol MgO / 2 mol Mg ) (40.31 g / mol ) = 24.87 g MgO formed