Did you ever do a barbecue? You first burn the light, hydrogen-rich substances of the firewood, with a large beautiful flame; that flame would burn down the meat, but it burns off quickly. What remains is charcoal, the source of most heat in the firewood; it does no produce a visible flame, but emits a lot of heat. It is mostly carbon.
How are we getting that out of a tree
https://en.wikipedia.org/wiki/Charcoal
Did you ever do a barbecue? You first burn the light, hydrogen-rich substances of the firewood, with a large beautiful flame; that flame would burn down the meat, but it burns off quickly. What remains is charcoal, the source of most heat in the firewood; it does no produce a visible flame, but emits a lot of heat. It is mostly carbon.