In this example you have 0.2 grams of carbon atoms. The first step is to find out how many moles this is.
The molar mass of carbon is 12.01 g/mol, you have 0.2 gram so:
$0.2 color(red)cancel(color(black)(g)) / (12.01 color(red)cancel(color(black)g)/(mol)) = 0.01665... mol$
The number of atoms can be calculated using Avogadro's constant that says that 1 mole of any element contains $6.022*10^23$ atoms. So the number of atoms in this example is:
$6.022*10^23 "atoms"/color(red)cancel(color(black)(mol)) * 0.01665 color(red)cancel(color(black)(mol)) = 1 *10^22 "atoms"$