So, here you have to look at the periodic table and see what the molar mass of each molecule composing the water compound
its two hydrogen atom plus an oxygen molecule, making it about 18g per mol.
That said, looking at the mass, we have to ask ourselves, if a mol of water contains 18g of mass, how many moles do we have in 0.5g of water?
We just do a cross multiplication: