Fossil fuels such as coal, oil, and natural gas were formed from the remains of ancient organisms over millions of years. Coal forms from peat deposits that are compressed over time into lignite, bituminous coal, and anthracite. Oil forms from the remains of marine organisms compressed under layers of sediment. Natural gas forms as organic material decays and is trapped under layers of rock that subject it to heat and pressure over millions of years. Refineries process crude oil by separating it into usable products or feedstock. Major oil spills like the Exxon Valdez and Deepwater Horizon caused environmental damage by releasing oil into coastal waters.