Use lipstick to test a door that won't latch.
Before fixing a wonky latch, you need to know what might be causing it. Some lipstick on the latch and masking tape over the strike plate will allow you to see where the alignment of the door is wrong so you can plan your fix accordingly.