About a quarter of the electricity generated worldwide is used for lighting. Energy efficient light bulbs based on light emitting diodes (LEDs) are about five times more efficient than traditional incandescent bulbs, and hence have the potential to allow enormous energy savings. The key material used in LEDs which emit white light is gallium nitride, a human-made compound, which has never been observed to occur in nature. Optimising this new material to make LEDs which are efficient, long-lived and reasonably affordable has been a huge challenge, and despite the undoubted commercial success of these devices many aspects of their operation remain mysterious. This lecture will explain how we can take LEDs apart, literally atom by atom, to understand their structure and how this controls their properties. The relevant techniques emerged from traditional metallurgy, but are now being used to understand materials for cutting edge optoelectronic devices, illustrating how the basic principles of materials science are vital to the development of the technologies of tomorrow.