Organic detrital rocks form when parts of plants and animals decay in the ground, leaving behind biological material that is compressed and becomes rock. Coal is a sedimentary rock formed over millions of years from compressed plants.
Sedimentary rock is the answer