To find the number of moles of a given mass of a compound, we have to use its molar mass. In this case, we have to use the molar mass of hydrogen peroxide (H2O2), which is 34 g/mol (you can calculate it by using the periodic table, the molar mass of hydrogen (H) is 1 g/mol and the molar mass of oxygen (O) is 16 g/mol).
The conversion from 4.0 grams to moles would be:
The answer is that there are 0.12 moles of hydrogen peroxide in 4.0 g of this compound.