Wood has chemical energy stored in the bonds between the atoms in molecules like cellulose. When it burns, oxygen reacts with the carbon molecules and releases that heat, making it exothermic. This is called combustion and that produces carbon dioxide and water (usually as a vapor becuase it's hot!) The energy is conserved, just converted between bonds and heat and light