Carbon dioxide is a very soluble gas. It dissolves readily in water. As the oceans formed, carbon dioxide dissolved to form soluble carbonate compounds so the amount in the atmosphere decreased. Carbonate compounds were then precipitated as sedimentary rocks, eg limestone.
Carbon dioxide was also absorbed from the oceans when the first plants and algae carried out photosynthesis. Many of these organisms, and those in the food chains that they supported were turned into fossil fuels, eg crude oil, coal and natural gas, which all contain carbon.