When you light a candle, the heat of the flame melts the wax near the wick. This liquid wax is then drawn up the wick by capillary action.
The heat of the flame vaporizes the liquid wax (turns it into a hot gas), and starts to break down the hydrocarbons into molecules of hydrogen and carbon. These vaporized molecules are drawn up into the flame, where they react with oxygen from the air to create heat, light, water vapor (H2O) and carbon dioxide (CO2).