One example of a fossil fuel is coal. Fossil fuels are formed from the remains of dead plants and animals that have been buried underground for millions of years. Over time, heat and pressure cause these remains to transform into coal, oil, and natural gas. Coal is a black or brownish-black sedimentary rock that is composed mainly of carbon and formed from the remains of plants that grew in swamps and marshes during the Carboniferous period, which occurred around 360 to 290 million years ago. Coal is burned to produce energy in power plants, but it also contributes to air pollution and greenhouse gas emissions.