1 atom of C has a mass of 12 amu (atomic mass unit).
1 atom of O has a mass of 16 amu.
1 molecule of CO₂ thus has a mass of 12 + 2×16 = 44 amu.
C thus makes up 12/44 ≈ 0.27 of the total mass of CO₂, while O makes up the remaining 32/44 ≈ 0.73.
Then in a 2 kg = 2000 g block of CO₂, carbon makes up about 12/44 × 2000 ≈ 545 g.