Fossil fuels are fuels formed from the remains of ancient plants and animals that have been buried underground. There are three main types of fossil fuels: coal, oil, and natural gas. Coal forms over millions of years as peat is buried and undergoes heat and pressure. Oil and natural gas also form from the remains of ancient organisms buried underground and subjected to heat and pressure over extremely long periods of time. Fossil fuels are important because they are widely used as an energy source, such as for producing electricity from coal or powering vehicles with gasoline.