If your door won't close properly, check the hinges. The most common problem you'll find is that the screws on one of them have worked themselves out and the loose hinge is making the door sag. You can fix this by tightening the screws. Another problem you might find is that the jamb itself isn't level and this is causing the door to lean. You could take the door down and reset the jamb, but there's an easier way to get the door working, and that's to shim out one of the hinges. This will work if the gap difference between the opposite jamb and the top and bottom of the door is less than about 3/8 inches. If the gap is more than that, you probably need to reset the jamb.