Within a material, what results in the conversion of an electron's energy to thermal energy and electromagnetical energy?
The electron moving makes an magnetic field, if it changes, there will be an electric field with the magnetic field.
Thermal energy is the result of collisions of the electron with other things.