'll explain you simply
When you go to college canteen, hotels etc., you find a exhaust fans on top. The reason behind this is to pump the hot air from inside to out side to make cool inside.
Why hot air?
Because the hot has less density (density is mass per unit volume, d∝m, d∝1/v) when the air heats up the molecules separates and become less mass and makes less density and moves up this is because of buoyancy force.(If you don't know about buoyancy, then google that)
here candle burning and makes surrounding air hot that makes decrease in mass,hence there is decrease in density, so air surrounded the flame and just under the flame makes less denser and starts moving up, while moving up the air makes the flame to shape which move up against the gravity.