A properly hung door stays shut when you want it shut and open when you want it open. If you have a door that continually defies your wishes, chances are the door is out of alignment.
Multiple unaligned doors in any home may indicate a more serious problem.
For minor alignment issues, tightening the hinge screws or placing shims behind one or more of the door hinges may solve the problem, but the proper way to re-align a door is to replumb the door frame.
Step 1: For doors with removable hinge pins, remove the pins and set the door aside. Otherwise, unscrew the hinges from the door jamb and remove the door from the frame.
Step 2: Use a hammer, nail puller and small chisel to carefully remove the trim pieces surrounding the door frame. Mark the underside of each trim piece with a Sharpie marker or pencil to facilitate re-installation of trim pieces once the frame has been replumbed.
Step 3: Use a 2-foot level to check the alignment of the top of the door jamb. Insert or remove shims as needed between the jamb top and the header or between the header and the top plate until the jamb top and header are level. Secure the jamb top and shims into place using 3-inch interior wood screws. Screws should be spaced a maximum of 12 inches apart.
Step 4: Use a 4-foot or longer level to check the alignment of the jack studs (shorter boards that run on either side of the door jamb from the base plate to the door jamb header). Install shims between the jack studs and king studs (studs that run from the base plate to the top plate on either side of the door opening) until each side of the door frame is plumb.
Step 5: Check the frame opening to assure it coincides with the door size. Make necessary adjustments before securing the jack studs and shims into place.
Step 6: Use 3-inch interior wood screws, spaced no more than 12 inches apart, to attach the jack studs and shims to the king studs.
Step 7: Once the door jamb is plumb and secure, re-install the door trim and re-hang the door. Use 3.5-inch interior wood screws to secure the jamb side of the hinges to the door jamb for added stability.