Before you buy a replacement lock try some quick remedies.
Door lock sticking out.
Put some graphite into the keyhole either by squeezing it from a tube or dusting it onto a key and then operate the lock a few times to work the graphite into the mechanism.
With the door latch stuck you want to know how to fix the issue but in order to do that you must find out the reason it is stuck.
A sticking door latch might require some lubrication or it might be jamming against the strike plate on the door jamb.
Many people put up with the aggravation of a sticking door lock for years.
After enough use you might find that your door lock has begun to stick making it difficult to put in turn or pull out your key.
Sticking door locks can be attributed to.
Exterior locks can freeze interior locks get dirty and small internal parts eventually wear out or break.
Ironically by cleaning and oiling them you can fix most locks in a matter of minutes.
You should first test the door latch to ensure the latch is sticking inside the door and not due to a misaligned strike plate.
First clean the keyhole with a penetrating lubricant like wd 40.
This occurs when dust dirt grime and other buildup accumulates on the internal mechanisms that control the movement of the lock.
There are several different ways a door latch can be stuck.
Fixing a few stubborn locks might involve disassembling cleaning and then reassembling the lock.
Turn the knob to open the door and release the knob slowly.