The only thing is that I didn't find the (delta) H for the target formula. I believe you can find it using the appendix of your book ( assuming they want you to find the Standard Enthalpies of Formation for the other formulas ).... For my rference to them in this answer, I substituted the values with variables....
To find Mg + 1/2 O2 --> MgO,
(1) Mg + 2HCl --> H2 + MgCl2 (delta) H = X
(2) MgO + 2HCl --> H2O + MgCl2 (delta) H = Y
(3) H2 + 1/2 O2 --> H2O (delta) H = -285.8 KJ
You know you already need the Mg and the 1/2 O2 on the left side and the MgO on the right side of the equasion.... I saw quickly that the Mg and 1/2 O2 are already on the left but the MgO in equasion (2) was on the left. Therefore, I switched it around. I ended with
(1) Mg + 2HCl --> H2 + MgCl2 (delta) H = X
(2) H2O + MgCl2 --> MgO + 2HCl (delta) H = -Y
(3) H2 + 1/2 O2 --> H2O (delta) H = -285.8 KJ
Basically, only the second equasion changed and the Y is now negative cause u switched the products and reactants....
I tried working it here and combining them. Everything proceeded to cancel out except for the Mg, 1/2O2 and MgO =) Hope you understood all that!
OH and I'm sure you know how to find the Standard Enthalpy of Formation for an equasion... But in case you don't it's .... [Sum Products] - [ Sum Reactants] -- Like I said, all enthalpies should be in the back of the book. Be sure you're careful to mind the state of the chemical. Certain substances like Water exist as a liquid and a gas at room temperature. Therefore, make sure you look at the GAS Enthalpy for gas and the LIQUID enthalpy for