First cut out a square piece of drywall that is a little larger than the hole itself.
Then take your square piece of drywall and hold it somewhat level over your hole and trace the shape onto the wall. Use a razor knife or keyhole saw to cut out the shape you traced on the wall.(A keyhole saw makes it a lot easier to cut out).Now you have the piece of drywall that fits in the hole.
Cut scrap wood or pieces of 2×4 about 3 inches larger than your hole and slide wood in behind drywall so that the 2×4 is completely across the hole on both sides and that you leave enough to screw your new piece onto. Screw your new piece of drywall onto the wall and your hole will be tight.Now you need to use your drywall mud and some drywall paper tape to tape the seems.Apply a slight coat of mud over the seems.
Cut the tape to fit over seems and apply one piece of tape at a time, making sure that underneath every piece of tape there is sufficient mud. Use a Broad knife or putty knife to smooth it out.
Let the tape coat dry.(usually several hours depending on humidity).Second coat the tape after dried.usually you would like to use a larger knife to do the final coat.
Let second coat dry overnight.Apply the final coat so that it fans out smoothly over the wall.Let dry overnight and sand smooth.Prime and paint..