There are a few basic steps. Consider the reaction of methane with oxygen.
What mass of carbon dioxide can be made when a mixture of 7g of methane and 40g of oxygen are ignited to make carbon dioxide and water.
1) Write a balanced reaction equation and from the quotients (numbers in front of formulae) you can tell the ratio of moles that react.
CH4 + 2O2 ---> CO2 + 2H2O
This tells us that 1 mole CH4 reacts with 2 moles O2 (and also makes 1 mole CO2 and 2 moles H2O).
2) Find the molar mass of the reactants and relate these to the quotients. This will tell you that you x grams of A react with y grams of B. If C=12, H=1 and O=16, then molar mass of CH4 = 16g and molar mass O2 = 32g.Using the quotients we can say that 16g CH4 will react with 64g O2.
3) Decide by calculation which reactant quantity in the question is limiting compared to values in 2) If 16g of CH4 react with 64g O2 then 7g of CH4 will react with 28g of O2. As we have 40g of O2, we have more than we can use. Oxygen is in excess and so methane is limiting.
4) Using the limiting reactant only, find how many moles of the product are made from the quotients in the balanced equation. Using molar mass, find the mass of this. We can then go back to the equation and say 1 mole CH4 makes 1 mole CO2, so 16g CH4 makes 44g CO2. All that is left is to find out what 7g of methane would make.