What kind of pistol? If it's a Glock - nevermind, it's ok !......just kidding, field strip it (detail disassembly if possible), rinse with clean water, blow dry with compressed air if available, "wash" it out with WD-40 making sure it gets in every nook and cranny and blow dry again or let drip dry, wipe parts off with WD-40 slightly dampened cloth, use your favorite gun oil in all the right places and reassemble. If it's a gun with wooden grips remove them and clean/dry/oil (polish) them too and your good to go. Some people scream that WD-40 is bad for guns - for what reason I don't know...my uncle is a retired gunsmith and he used it a lot, he was taught it's use in gunsmithing school as a matter of fact....very helpful in cleaning/lubricating mechanisms that are unable to be or shouldn't be taken apart. I've used it for years as a "cleaner" and protector for my guns following up with a good oil (usually motor oil - synthetic nowadays = Amsoil) in all the right spots and never had a problem with it. I believe that WD-40 got a bad rap from people that misused it by just spraying some into the actions on their guns and never took them apart and cleaned them properly - I've seen this with pump and semi auto rifles and shotguns...sigh.
As always, YMMV.
Ken
*Edit* After posting I saw that Old Fuff and mastinson had already beat me to it with the WD-40 suggestions ! .........