Here is a general way to convert moles to grams.
Given: What is the mass, in grams, of 2 moles of water?
Since 18.0 grams = 1.0 moles of water, we can construct a conversion factor for changing moles of water to grams. The numerator of the conversion factor equals the denominator.
Notice that moles cancel giving the answer in grams.