We’ve written before about Retr0brite, a technique that originated among vintage computer/electronics enthusiasts for restoring original factory case colors after years of weathering and yellowing. As it happens, the same technique can be used to restore old, yellowed Lego elements, and there is in fact an entire site dedicated to the method, which involves making a gel from 11% hydrogen peroxide, glycerine, vegetable gum, and a touch of sodium percarbonate (OxiClean). The gel is liberally applied to the yellowed plastic and exposed to a strong UV light source, e.g. sunlight, over the course of a couple days.
Turns out the yellowing of old ABS plastic is due to degradation of bromine-containing fire retardants which are added to the plastic during manufacture, which release elemental bromine, causing the yellow color. Shining UV light on the gel accelerates the decomposition of the fragile oxygen-oxygen bond in the peroxides it contains, generating reactive hydroxyl radicals which scavenge the free or loosely-bound bromine in the plastic that causes discoloration.