The early atmosphere contained a large amount of carbon dioxide. As the oceans formed, much of this gas moved out of the air and into the water.
Carbon dioxide is soluble in water, which means it can dissolve. As more oceans formed there was more water for the gas to dissolve in, so the amount of carbon dioxide in the atmosphere decreased.
Some of the dissolved carbon dioxide went on to form insoluble carbonates, which settled on the sea floor as sediment. Over a very long time this also helped to remove carbon dioxide from the air.