I use alcohol and q-tips. When it's really bad, I dip an old toothbrush in the alcohol and brush the threads in the same direction you unscrew. After that my o-rings get a good ol layer of lubrication.
You don't need to do this just because they look dirty, but if your light flickers, won't turn on or the threads feel gritty, then this should solve the problem. It is good to do it every now and then if you use the light a lot. I try to do this at least once or twice a year on the lights I barely use (takes a whole evening with all the lights I have)