calculate the number of atoms of C of 25.0g C?

25.0 g C x (1 mole/12.01 g C)---this first factor convert g C to moles C. Then we use a second factor to convert from moles to number of atoms, like this.

25.0 g C x (1 mole C/12.01 g C) x (6.02 x 10^23 atoms C/1 mole C) = ?? atoms C.

Again, note that g C in the first number cancel with g C in the first factor and this converts 25.0 g C to moles C. The second factor you will note cancels moles C but leaves atoms C. So the answer comes out in units of atoms C which is what you want.