Most appliances that heat up, such as hair dryers, irons, and toasters, work by changing electrical energy into heat energy. Toasters are plugged into a source of electricity. From that source, the electric current runs down the wire and into the toaster. The inside of each appliance contains loops of different metals. The electricity does not easily flow through the metals. The metals slow down the electrons and hold up the current, which is resistance. Resistance is a measure of the tendency of a material to resist the flow of an electrical current, in physics. The higher the resistance, the hotter the metal will get. This happens because of the friction of the electrons.
The wires begin to heat up and glow because they are so hot. This heat is what toasts the bread.
Overall this is very random, but its cool to see how everyday appliances like toasters relates to physics!