Convection is the transfer of heat from one place to another due to the movement of the medium particles.
Convection is a type of heat transfer that can only happen in liquids and gases because it involves those liquids or gases physically moving.
Convection happens when there is a difference in temperature between two parts of a liquid or gas.
When the air gets hot, the molecules of air move away from each other and thus the air becomes less dense. Less dense air is lighter and therefore it rises up carrying heat energy along with it. Cold air from the sides rushes in to take its place. Since the heat energy is carried by the actual physical movement of the air molecules therefore heat transfer takes place in the air by the process of convection.