Coal is a nonrenewable, combustible black or brownish-black sedimentary rock formed from ancient plant matter under heat and pressure over millions of years. It is primarily used as a fuel for generating electricity, where its combustion creates steam to drive turbines. The main types of coal, based on their carbon content and energy output, are anthracite, bituminous, subbituminous, and lignite.