Here's a relevant video from someone I watch on the occasion.
I have done it with several vintage stormtrooper figures, the star wars collecting community absolutely frowns on this practice though. They claim it does weaken the plastic and makes it become brittle. If overdone it can make white plastic turn pink forever also, I have seen some pinking but not weakening myself so do it at your own risk, also know that it will destroy any stickers and fade some printed tampographs
peroxide and bleach are also known to be used on yellowed lego, but i have also seen comments relating to weakening if the mix is too strong. i wouldnt try it myself, and tend to leave the bad whites out, however even well kept stuff will turn over the years. my disney castle is primarily white and tan, and will look dreadful in years to come, sadly.