The direction of heat flow between the air and the water in the can before the candle is lit is from the air to the water because the air is at a higher temperature than the water.
Heat always flows from a hotter object to a colder object. Heat is a form of energy that is transferred from one object to another due to a difference in temperature. The hotter object has more thermal energy than the colder object, and this excess energy is transferred from the hotter object to the colder object until they reach the same temperature.
Thermal energy is random. The atoms and molecules in a hotter object are moving faster and more randomly than those in a colder object. This random motion causes the atoms and molecules to collide with each other and exchange energy. When a hot atom or molecule collides with a cold atom or molecule, it transfers some of its thermal energy to the cold atom or molecule.