Use the unit factor method. We are told the sample contains $6.02 \times 10^{24}$ molecules of CO.
Divide by Avogadro's constant to switch from molecule count to moles:
$$n(\text{CO}) = \frac{6.02 \times 10^{24} \text{ molecules}}{6.022 \times 10^{23} \text{ molecules/mol}} \approx 10 \text{ mol}$$
Now write the mole ratio directly from the formula CO: 1 mole of CO always supplies 1 mole of carbon atoms and 1 mole of oxygen atoms, because there is exactly one atom of each element per formula unit.
$$10 \text{ mol CO} \times \frac{1 \text{ mol O}}{1 \text{ mol CO}} = 10 \text{ mol O}$$
So 10 moles of CO deliver 10 moles of oxygen atoms. That matches option D, 10.