To make a candle, you dip a piece of cotton string into melted paraffin. As this is continued, the string gets coated with paraffin. Paraffin is solid hydrocarbon that is a product of crude oil. The wick at the top of the candle is the cotton string that is coated with paraffin. When you light the string, the heat causes the paraffin to become a flammable gas. This process will continue until all of the paraffin is burned up. I hope this is helpful for you. When I was in young, I did a lot of camping in my tent. These small candles are a good way to start a campfire.
If you mean how candies burn, it is because the main ingredient of candy is glucose. The formula of glucose is C6H12O6. If you grind it into a powder, you can burn it. The products are carbon dioxide and water.
C6H12O6 + 6 O2 → 6 CO2 + 6 H2O + heat