Over time door locks can get clogged with dirt and dust, increasing friction and allowing them to stick. Fixing a stuck lock is a moderately simple task. The tools required are basic ones most homeowners have on hand, and the job takes around 10 to 15 minutes to complete.
Use a Phillips head screwdriver to unscrew the lockset from the door. (Most locksets are held in place with two long screws. Removing them requires many turns.) Set the screws aside and pull the lockset away from the door.
Using a Q-tip and a bottle of rubbing alcohol, clean all of the exposed components of the lock. Continue, using clean Q-tips as necessary, until the Q-tips remain clean when you swab them on the lock. Pour a small amount of rubbing alcohol into the key hole, and let it set for a minute. Slide the key in and out several times to loosen any gunk inside the mechanism.
Spray the internal components of the lock with a thin coating of WD-40. This will help lubricate the parts and keep the lock functioning properly. Using the straw attachment, also spray a small amount of WD-40 inside the key hole.
Reinstall the lockset on the door, and tighten the screws.
If the lockset still doesn't work, your key may be damaged or worn out. Replace the key.