For this type of problem, we use the molar mass and avogadros number in order to solve the question.
Mass of compound -> Moles compound -> number of particles
this step is vice versa.
Let me show you an example.
100 grams of NaCl
100 grams NaCl -> moles NaCl -> number of particles
`100 g NaCl x ((1mol NaCl)/(58.44gmol-1)) x ((6.022x10^23 particl es)/(1 mol NaCl))`
= 1.0305x10^24 particles
Now to work on from particles to the molar mass of compound, you just have to reciprocate the values. For example 2.00x10^24 atoms/particles of gold
`2.00x10^(24) particl es Au x ((1mol e Au)/(6.022x10^23 particl es)) x ((196grams)/(1mol e Au))`
= 654 grams of gold (Au)