Check the door hinges. Make sure the door hinges are tight and that the door is not sagging. If the door is sagging, the door knob latch will not always align properly with the strike plate. Place a magazine beneath the door to ensure it is not sagging, then tighten all of the door hinge screws with a screwdriver.
Make sure the strike plate is not loose. If the strike plate moves, it can prevent the latch from catching properly when you shut the door. Open the door and wiggle the strike plate to see if it moves. Tighten the screws in the strike plate.
Push the end of the latch into the door knob. Add a drop or two of lubrication to the latch if it catches or does not push in and out of the door knob smoothly.
Check the alignment of the latch and the strike plate. Smear a dab of petroleum jelly on the end of the latch. Shut the door so the latch makes contact with the strike plate. Check the strike plate to see if the petroleum jelly is above or below the strike plate. Adjust the strike plate accordingly. Unscrew and lower the strike plate if the jelly is below the strike plate opening, raise the strike plate if the jelly is above the opening.