Just a footnote to the general consensus here re any contact cleaner. Yes, this is true, we can argue til the cows come home about whioch specuifric contaqct cleaner is best (I have used some generics and Deoxit; Deoxit is better than the other cleaners I have used) but that's not my concern here.
The above ONLY applies to carbon track pots. Granted, the vast majority (99%) of guitars use carbon track pots, but some (more and more every model year) have switched to conductive plastic (like the pots/faders in most high end mixing consoles) ... and I guess we all have other gear with pots in it that might need cleaning (e.g. my 70s Tapco 4400 reverb has CP slide pots on it). You can usually tell because they look very different. Some CP pots are sealed so you cannot clean them and don't need to, but some aren't. You cannot use just a contact cleaner; they require conductive lube to operate properly and contact cleaner will strip it. Instead use a CP safe product such as the Fader series by Craig (makers of Deoxit).
Carbon track pots do not require FaderLube (and Craig does make 2 in 1 products that both clean and lubricate), though it may improve the feel of the pots after cleaning (I do not recommend that for the same reason people above are skeptical about using WD40 - dirt sticks to the lube requiring more frequent cleaning). CP pots (and sliders) require it to function properly.