Cold weather, dirt and age can cause door locks to stick. Ice can prevent you from putting in the key, or the key from turning, as can corrosion or dirt in the lock mechanism. Another common problem with locks is that you can turn the key, but the deadbolt itself won't move, or moves very slowly. Most causes of a stuck door lock are easily repaired, but if the lockset is damaged, or you happen to have the wrong key, you might need a new lock or a locksmith.
Confirm that you have the right key. Double-checking this obvious requirement can save you from unnecessarily taking apart your lock.
Apply graphite spray to the inside of the lock if you can't insert the key, or if the key gets stuck halfway. Graphite spray might also free the lock mechanism if you can insert the key but it won't turn.
Hold the key with gloves and heat it with a lighter if the temperature is low enough to produce ice in the lock mechanism. Push it in as far as it will go, then take it out and heat it again. Repeat this until the key is fully inserted and the mechanism turns.
Tighten the screws holding the mechanism to the door if the entire lockset turns when you turn the key. Pry off the plate on the inside of the door with the slot screwdriver, or unscrew it with a Phillips or slot screwdriver, then tighten the screws holding the two halves of the lockset together with the Phillips screwdriver.
Check the alignment of the latch and the strike plate in the jamb if the key is hard to turn, or turns slightly and then gets stuck. If the latch is hitting the strike plate, try tapping the opening with a hammer and slot screwdriver to make it wider. If you have to reposition the strike plate, unscrew it and fill the screw holes in the jamb with epoxy wood filler. Let the filler set, then reposition the strike, drill new holes and redrive the screws.
Check the door alignment and hinges if the latch continues to get stuck in the strike. If the door is crooked, the latch will not seat correctly. Loose hinge screws are a common cause of crooked doors.
Don't use a petroleum-based, lubricant spray to free your lock. It can collect dust and cause more problems in the future.