Use something like NaOH, KOH, Ca(OH)2. These will react with the CO2 in the air to give the corresponding bicarbonates/carbonates. They won't react with N2, O2, or Ar. Then dry the carbonates in an oven to get rid of the water and then heat them up to decompose them into CO2.