Step 1: An LED is a semiconductor diode that is designed to give out light when a forward current passes through it, unlike an ordinary diode, which is built only to allow current in one direction without any special light output.
Step 2: Inside the LED, the semiconductor material has a p type region and an n type region joined together. When a forward voltage is applied, electrons from the n side and holes from the p side move toward the junction and recombine there.
Step 3: Each time an electron recombines with a hole, it drops from a higher energy level to a lower one, and the extra energy is released as a photon of light. This process is called electroluminescence.
Step 4: The colour, or wavelength, of the emitted light depends on the energy gap of the particular semiconductor material used, so different materials such as gallium arsenide, gallium phosphide, or gallium nitride give red, green, or blue LEDs respectively. In all the common indicator and display LEDs, this emitted light lies in the visible part of the electromagnetic spectrum.
So the LEDs commonly used in electronic devices emit visible light, not X rays, ultraviolet light, or radio waves.