Locate the position of the nearest stud or joist on either side of the hole. Using a carpenter's square, mark an opening with 90-degree corners to be cut around the hole. Draw along the inside edges of the two studs or joists that flank the hole, and along any framing members between them.
If a stud frames a window or door, continue the marks to the next stud: doing so avoids a joint in line with the opening, which would otherwise be subjected to cracking from repeated opening and closing. Where a hole lies within eight inches of an inside corner, draw to the end of the panel to avoid forming a new joint too close to the corner.
Use a utility knife to score along the ceiling and all pencil marks before sawing out the damaged area. Then cut out the sections of drywall between framing members with a drywall saw or a keyhole saw. Clean the edges of the cuts with a utility knife.
If the damaged area came out in one piece like the one shown in the image, use that section as a template when cutting a patch. Be sure to match the tapered area of the new piece with that of the old one.
Otherwise, measure each side of the opening as well as the sizes and positions of any electrical boxes, door frames, or window frames within it. Transfer the measurements to a panel of the same type and thickness as the damaged drywall, using a carpenter's square to ensure 90-degree corners. Don't use the panel's tapered edges for the patch's edges unless an edge of the opening falls at an inside corner.
Cut out the patch, positioning the saw blade on the outline's inner edge; for an opening within the patch, cut just outside the line.
Cut 2x4 or 2x2 cleats to fit alongside the joists or studs at the edges of the opening. Where possible, cut the cleats 2 to 3 inches longer than the opening.
Secure the cleats flush with the studs or joists by driving 3-inch screws every 4 to 6 inches along the cleat.
Before positioning the patch, mark the location of any exposed stud or joist on the wall or ceiling near the opening. Fit the patch in the opening and drive 1-5/8-inch drywall screws through the patch about every 6 inches into each cleat, stud or joist, starting at the middle and working to the edges. Do not screw the patch to a top plate or a sole plate.
Cut a piece of fiberglass tape to the length of the edge seam plus an extra two; press the tape in place over the crack. Continue in this manner until the whole seam is covered.