Correct a door's alignment without removing it by tightening the screws in the hinges, replacing existing screws with longer ones or adding shims to certain hinges. There are a variety of products available to help shim doors, but results are also possible with ordinary household materials.
Before making adjustments, inspect the door to determine where gaps are and which hinges to focus on. For example, if the door sags on the end with the doorknob, tighten the top hinge and shim the lower ones. To tighten hinges, attempt to tighten each screw with a screwdriver. Over time, screws might have simply loosened, but some might have stripped their holes to become unusable. If a screw will not tighten, replace it with a 3-inch screw to reach the stud beyond the door jamb.
If the door is still misaligned, use a long screw in one of the hinges, whether the screw has stripped its hole or not. Installing a long screw in the center of the top hinge pulls the top of a door closer to the frame. For extreme cases, remove the hinge opposite of the biggest gap and install a shim behind it, pushing the hinge closer to the doorknob side. Craft shims from thin pieces of cardboard, or buy plastic ones from a hardware store.