Dead organic material accumulates on the bottom of oceans, seas, riverbeds or swamps, mixing with mud and sand. Over time, more sediment piles on. The resulting heat and pressure transform the organic layer into a dark and waxy substance known as kerogen. Kerogen eventually breaks up into either crude oil or natural gas.