The coal is formed  when water and dirt cover plants which was there millions of years ago.Then rocks,sediment and dirt create pressure and heat creating coal.Thank you

About 300 million years ago, earth had many dense forests in low lying wetlands. Due to natural processes the forest got buried. They were compressed when more soil deposited over them. As they sank deeper and deeper temperature also rose. Dead plants slowly converted into coal under high pressure and high temperature.
1 5 1
Hope it helped
please thank me and rate my answer
can you become my friend?
hello please:-[