Coal is a black, hard fossil fuel that was formed from the remains of ancient vegetation buried under soil and compressed over millions of years. It is an important natural resource used as fuel for cooking, in steam engines, power plants, and various industries. There are different types of coal that contain varying amounts of carbon. Coal mining extracts coal from underground mines and is used worldwide as an energy source. When coal burns, it produces primarily carbon dioxide and also yields other byproducts like coke, coal tar, and coal gas through processing.