Door knob lock not moving when turned to lock
I've encountered this issue before and the repair is easy.
The problem is with the lock (latch) being misaligned. This is the part of the door knob that moves back and forth and holds the door closed.
With a screwdriver loosen the 2 screws holding it in place. 1-2 turns should be enough. Twist the door knob to check if the latch moves freely.
If it doesn't verify that the latch is lined up correctly with (and not rubbing against) the latch plate (the plate guiding the latch).
If still not working correctly loosen the 2 screws that hold the door knobs together. Move them until the retracted and stuck latch springs out and then re-tighten the screws.
It's tempting to use an aerosol lubricant to free the latch (i'm guilty of this too), but it doesn't help in the long term. It will attract dust and build up grime that hinders the door lock mechanism.
Sometimes it's less hassle to install a new door knob.