Therefore are 4 atoms of H on the left side of the equation and 2 atoms on the right side. It can be balance by putting 2 in front of H2O as shown below:
CH4 + O2 —> CO2 + 2H2O
Now, there are a total of 4 atoms of O on the right side and 2 atoms on the left. It can be balance by putting 2 in front of O2 as shown below:
CH4 + 2O2 —> CO2 + 2H2O
Now, we can see that the equation is balanced as there are equal numbers of atoms of the different elements present on both sides of the equation.