Electrical energy in the stove is transformed into heat. The heat flows to the water in the kettle, increasing the internal energy of the water. As the energy in the water increases, the water molecules move faster until the liquid water becomes water vapor. The water vapor does work on the whistle, causing it to make a sound. Energy is neither created nor destroyed, it has simply changed form in the process.