Part graveyard, part rubbish dump, sediment contains carbon in the broken remnants of living things. Rivers pick up the remains of animals and plants, containing organic carbon. This is carried for a while, then dropped where the river slows down at bends, or in deltas where it meets the sea.
Millimetre by millimetre the sediments grow.
In freshwater wetlands, plants fall and settle where they die. The organic carbon they contain accumulates slowly.
In the sea, the bodies and shells of plankton and larger animals fall through the water. Much is dissolved, but ultimately some is deposited as sediment on the ocean floor.
In shallow tropical seas, coral skeletons and animal shells make up much of the sediment. The carbon in these is in the form of calcium carbonate.