For these reasons, it's a good idea to perform regular maintenance on your pocket knives. I like to clean and lubricate mine once a month or so. This is also a great time to inspect your knife for other potential problems like corrosion on the blade or internal components, as well as checking for loose screws.
Step 1: Cleaning
If you've just got some light pocket lint, you can usually use a toothpick, screwdriver, or other probe to remove it.
If you've got sand and grit, you'll likely want to use warm, soapy water and wash the knife with a bristle brush (I like to use an old toothbrush). If you do go this route, go ahead and brush down the entire knife including the blade and the handle scales. Often, this is all it takes to restore your handle scales to their original luster. Don't be afraid to get the internals wet or soapy, remember that's the most important area to clean. Just make sure to rinse well.
If the knife has an excess of sticky or grimy buildup that won't come out with either of these methods, try placing the knife in a bowl of warm water, which should help loosen the grime. A comment below from Instructable user Denger mentions that one should be careful or avoid using this method on knives using natural materials such as wood, abalone, or mother-of-pearl, and that even synthetic handles may be damaged if left for too long in water at or close to boiling temperatures. Then try the probing method, followed by the wash method. This should take care of even the toughest residue.
If your knife is still gritty or difficult to open, you may need to disassemble the knife for a more thorough cleaning, which we won't cover in this article. You will likely need specialty tools and the process will vary widely depending on what knife you're working on. Many knife manufacturers will also tell you that disassembling your knife will void your warranty.
If you have used either of the wet methods for cleaning your knife, be sure to wipe up any excess water and allow the knife to air-dry for at least 15 minutes before moving on to lubrication. Even if your knife uses stainless steel, it may still be subject to corrosion.
Step 2: Pick a Lubricant
The most popular lubricants are petroleum-based wet lubricants, and are essentially the same as gun lubricants or sewing machine oil, although they will claim attributes which make them superior to their competitors. Two great choices would be Sentry Solutions Tuff Glide or Benchmade Blue Lube, which I use primarily because it is available to me.
Dry lubricants are often PTFE (teflon)-based and tend to attract less pocket lint. They typically come in either an aerosol can for spray-on application or as a grease tube, and dry on the surface leaving a protective, lubricating film. A few examples would be Super Lube, Miltec, or Chris Reeve Fluorinated Grease.
It is important to remember that if your intend to use your pocket knife for food preparation, such as cutting up an apple, you may want to use a food-safe lubricant. You can use simple vegetable oil, but it isn't very stable and may go rancid. Food-safe mineral oils (such as wood block oil) tend to work well. Here's one great choice. Plain jane food-grade mineral oil should be available at your local pharmacy (as suggested by several commenters) for cheap also. Personally, I use the petroleum-based stuff just fine. I apply oil sparingly at the pivot, wipe up any and all excess, and rarely find it escaping out into a pocket or onto the blade where it could come into contact with food stuffs. But to each her own!
Step 3: Apply Your Lubricant
Your goal is to use just enough lubricant to spread throughout the target area (usually the pivot or locking surfaces) without seeping out onto the handle or blade. An excess of lubricant, especially oily wet lubricants, will actually attract pocket lint and other material, meaning you'll have to clean your knife more often.
If the blade of your knife is made of a high carbon steel (either a high-carbon stainless or a true carbon steel) you may also want to use a preventative coat of lubricant on the blade itself, especially if you use it in or around water or live in an area with exceptionally high humidity. While the Japanese ZDP-189 used in my Spydercos is about 3% carbon (two-to-three times the carbon content of most stainless steels) it is also about 20% chromium, and since I clean my knives regularly, I don't bother coating the blades.
If your knife has wood handle scales such as a Buck model 110, consider rubbing them down with a wood polish or finishing oil such as Danish or Linseed oil.
Wipe off any excess oil and enjoy your knife! For further reading, check out this article at KnifeCenter.