Lubricating door locks is an easy effective way to get them working smoothly. The door strike can be lubricated with the lock or knob still in place.
See the articles 'How To Fix a Door' and 'Repairing Door Locks' for a listing of door repair topics.
Purchasing Door Lock Lubricant
You want to use a silicone based non-staining spray to lubricate your locks. Graphite is not a good choice, since it can get on other surfaces and stain them.
Lubricating the Door Lock
Use some silicone spray and work the knob back and forth until it moves freely. The same may be true of the lock tumblers. Spray some lubricant inside the key hole. Use the key to work the tumblers until the oil sets in and the lock works.
The other moving parts of the lock will require that you remove the cover plates to lubricate them. Most locks are held together by two machine screws. The heads usually face the inside of the door. Residential grade locks can normally be taken apart with just a screwdriver. The lock should come apart in two pieces. The strike mechanism can stay in place once the knob and cover plates are removed.
Lubricate all the moving parts and work them until they move freely. Re-assemble the lock and the door should work. An old badly corroded lock or a broken lock, will probably not respond to just oiling it. A lock that is too far gone will need to be replaced. Check Step Six below for information on replacing a lock.