Deltas - the area of land where rivers meet the sea - are built up as sediments pile on sediments. Over millions of years, the sediments - and any carbon they contain - can become buried several kilometres underground as the layers of the sediment pile up. As a result of compaction and chemical changes the sediment is converted into solid rock. This transformation is called lithification (literally, the process of turning into stone).
Deep in the Earth, the pressure and the temperature are high and the sediments are compacted and chemically changed. Limestone, for instance, is a carbonate rock. The sediment that formed it came from the shells and skeletons of billions of plankton and corals.
Oil shale is an organic sedimentary rock (it contains organic carbon) from the soft tissues of plankton or the bodies of animals and plants - and is another product of the process of lithification.