There exists different forms of energy, such as electrical energy, chemical energy, mechanical energy, nuclear energy, gravitational energy. These forms of energies can be converted between one another, such as electrical energy can be converted into sound energy and so on. Though, you need to remember that according to the law of conservation of energy, no energy is lost when the conversion between different forms of energies occurs.
Hence, the electrical energy that powers the flashlight undergoes several transformations. Chemical energy contained by batteries is stored in the bonds holding chemical compounds together. When the flashlight is turned on, the chemical energy stored in batteries is converted into electrical energy that flows through wires of flashlight. This electrical energy is then transformed into light and heat energies. Light energy is used by the light bulb, which becomes hot as long as it is in function, hence, some of the light energy is then converted into heat energy.