Water has 2 hydrogen atoms and one oxygen atom.
The atomic weight of hydrogen is 1.00797 and for oxygen the atomic weight is 15.9994.
So the molar mass of H2O is 15.9994 + (2 x 1.00797) which equals 18.01534 grams/mole.