My desk flashlight has three “functions”:
- 5 UV LEDs
- 10 white LEDs
- laser pointer
A four-click rotary pushbutton switch actuates the three functions (plus “off”) in sequence:

All three lights became intermittent, which suggested a poor return connection at the far end of the battery. The case is, of course, aluminum, with coarse-cut threads that grate as you tighten the parts. I cleaned the crud out of the threads, anointed them with Ox-Gard compound, and discovered that the laser and UV LEDs were still flaky.
Taking the thing apart and unsoldering the switch connections revealed the problem:

Yup, two lousy solder joints. They’re not exactly cold solder joints, because there’s not really a joint there to begin with; the switch tabs never got hot enough to bond with the molten solder before it cooled.
A dab of flux and touch from a hot soldering iron solved that problem.
Assemble in reverse order and it works better than it ever did before!