Fossil fuels such as petroleum, coal, and natural gas are nonrenewable energy resources formed from the remains of ancient plants and animals. Petroleum is a liquid fossil fuel that provides over 40% of the world's energy through gasoline and other products. Natural gas is a gaseous fossil fuel used mainly for heating and power generation, while coal is a solid fossil fuel that produces more air pollution but is still widely used by power plants. Fossil fuels form over millions of years from the compression of ancient biological material and are extracted through drilling or mining depending on the type and location underground or offshore.