Heating of a sugar is a physical change.
When a substance undergoes a physical change, its composition remains the same despite its molecules being rearranged. It is temporary change and affects only physical properties i.e. shape, size, etc
Carbon, hydrogen, and oxygen atoms make up sugar. These elements react with the fire and transform into a liquid when heated over a candle. The sugar’s atoms interact with the oxygen in the air, creating new groups of atoms as a result of the heat. The chemical reaction releases energy in the form of smoke and black soot. As a result, only the physical state changes.