For each of these, first find the molar mass of the molecule by adding up all the individual molar masses of the elements within it from the periodic table. The molar mass gives us g/mol so if we flip it and multiply by the gram values, we get the proportional number of moles in our number of grams and the gram units cancel out. Now we have the number of mols of the compound in the given grams of sample.
I have attached all the work to the problems.