Coal is very close kin to the other fossil fuels, oil and gas. If a chunk of coal is examined with a powerful magnifying glass you will notice a lot of red and gold color. The marks of plants can be plainly seen on many pieces. The imprint of plants and sometimes of animal skeletons indicates to skilled scientists how coal was formed.
Turner, George M., "Energy in Agriculture: Energy Resource Series for Youth and Adult Energy Programs: 4. Coal" (1981). Agricultural Engineering Energy Series. 12.