Coal is actually the petrified remains of plant material, subjected to levels of high heat and seismic pressure to form a carboniferous material which can burn for long periods of time.
Coal had a limited use in medieval times, but was the fuel of choice only for blacksmiths. Coal fumes made it less desirable than wood, especially as coal burns poorly. But if wood was short, or coal was cheap, then coal might be used, even if it was used reluctantly. Deforestation during the Middle Ages and a shortage of timber in the Industrial Era soon meant that coal was the only viable fuel source and coking agent for the production of steel.