Aluminum foil is a conductor of heat energy. However, it does reflect radiation from heat sources, so it can reduce heat transfer through radiation. When aluminum foil is wrapped around something, pockets of air can be trapped. Trapped air is an excellent insulator against conduction and convection. However, if you want to prevent something like a can of soda from getting warm in your lunchbox, a wool sock will be a better insulator. Even paper toweling is better at insulating than aluminum foil when light is not shining.