We need to rearrange the individual steps in order for the sum to give the desired equation: #CH_4(g) + 2O_2(g) → CO_2(g) + 2H_2O(l)#
For that we will do the following: Step 1:
Since #CH_4# is needed to be in the reactant side, we will flip the reaction and in this case, we reverse the sign of #DeltaG#: #CH_4(g)->2H_2(g) + C(s)" " " "-Delta G = 51 kJ#
Step 2: #2H_2(g) + O_2(g) → 2H_2O(l) " " " "Delta G = -474 kJ#
This equation will be left the way it is.
Step 3: #C(s) + O_2(g) → CO_2(g)" " " "Delta G = -394kJ#
This equation will be left the way it is.
Now we sum these three steps: #CH_4(g)->cancel(2H_2(g)) + cancel(C(s))" " " "-Delta G = 51 kJ# #cancel(2H_2(g)) + O_2(g) → 2H_2O(l) " " " "Delta G = -474 kJ# #cancel(C(s)) + O_2(g) → CO_2(g)" " " "Delta G = -394kJ# #-------------------# #CH_4(g) + 2O_2(g) → CO_2(g) + 2H_2O(l)" " " "Delta G = -817kJ#
Here is a video about Hess's Law: Thermochemistry | Hess's Law, Enthalpy and Heating/Cooling Curve.