Hey Alexa,
1) Balance your equation. I'd start by balancing Nitrogen first, then adjusting as necessary. This is important, as you will eventually need to know the ratio between moles of H2 and moles of NH3
2) Determine the # of moles of NH3. Do this by calculating the molar mass, which you can always check online. Molar mass is measured in g/mol, so if you divide 40.0 g by the molar mass, this will tell you how many moles of NH3 you have.
3) Use the molar ratio (found from the balanced equation) to set up a conversion factor: # moles NH3 * (coefficient for H2 / coefficient for NH3
4) Convert moles of H2 into grams. Find the molar mass of H2, then reverse step #2: convert from moles into grams to get your final answer.
As a check, your answer must be less than 40.0g, due to conservation of mass in a chemical reaction.
Hope this helps,
Chris