Just like anything with moving parts, locks can deteriorate and get dirty over time, making the key hard to turn to the point where the door can be impossible to open without breaking the lock or the key. Because the interior of a lock is designed to be inaccessible, this presents a problem with keeping a lock easy to turn and open because there is no easy way to take a lock apart and put it together again (unless you are a trained locksmith).
Use a pencil
There are however some steps you can take to try and ease the key turn. One common home solution is using the graphite from a pencil lead on the key. Simply rub the pencil lead against the teeth and sides of the key to coat it and then jiggle the key around in the lock.
Use a drop of oil
If there is still some resistance, a drop or two of lubricant applied directly to the entry of the lock or to the key again may do the trick. Should this not resolve the problem, you will need to remove the lock and take it to your local locksmiths for cleaning and repairs.
Sometimes the issue isn’t with the lock itself, but a build-up of debris in the strike plate and/or mortise. If this is the case, simply clear it out and try to lock the door again. If necessary, remove the strike plate and use a small chisel or drill bit to deepen the mortise so it will accept the bolt. You may also need to tighten the hinges to realign the bolt with the mortise if the door has sagged a little over time.