The organic sedimentary rock formed from plant materials that is used primarily to generate electricity is coal. Coal is a combustible black or brown sedimentary rock formed from the remains of plants that lived millions of years ago in swampy forests. It is primarily composed of carbon, along with hydrogen, oxygen, nitrogen, sulfur, and trace amounts of other elements. Coal is a valuable natural resource used as a fuel source for electricity generation, heat production, and industrial processes. It is also converted into various products such as coke, coal tar, and synthetic natural gas.