Coal is the result of the pressurization of organic material (trees, plants, animals,etc.) over thousands of years. The molecules in the material are rearranged into coal.
Coal is formed from remains of vegetation that grew millions of years ago when plants &trees died their remains sank to bottom of swampy areas aaccumulating layer upon layer & forming saggy materialcalled creasingly deeper burial & heat associated changed it to coal.