A mole is a counting unit: $6.022 \times 10^{23}$ particles. The molar mass (grams per mole) is the sum of the atomic masses in the formula.
Molar mass of H2O
$2(1) + 16 = 18$ g/mol, so 36 g of water is $36 \div 18 = 2$ moles.
Stoichiometry roadmap
grams of A → moles of A → (use the coefficients) → moles of B → grams of B
The coefficients in a balanced equation are mole ratios. In 2H2 + O2 → 2H2O, 2 moles of H2 make 2 moles of water.