Coal is an example of a sedimentary rock. Sedimentary rocks are formed from the accumulation of sediments or organic matter. Coal is formed from the accumulation of dead plant material in swamps and marshes. Over time, the weight of the sediment on top of the plant material causes it to be compacted and heated, eventually forming coal.