Drywall repair problem
Use a drywall knife or small saw to cut the hole into a square or rectangular shape, large enough to insert a length of 1x or 2x (depending upon the size of the hole, I've even used paint sticks for small holes). Use a drywall knife to gently cut into the painted paper outer layer of the drywall, angling inward toward the opening ... this makes the finish process easier ... all around the edges of the opening.
While pulling the board tight to the back of the existing drywall (board should extend well past the edges of your new rectangular hole), put in two or three screws through the drywall into the board on both sides of the hole (not too close to the edges of the hole). Be sure to sink the screws just enough so that mudding over them will leave no bump. 
You can put a couple of screws partway into the insert to handle it by, if the hole is too small to just use your hand to hold it in place. Remove those screws before setting the patch piece.
Once the board is secured, cut and insert a matching thickness of drywall. the closer to the same size, the better.
Use a drywall knife to gently cut into the paper outer layer of the drywall angling out to the edges of the patch piece.
Place the patch, securing it to the backing board you inserted with several screws (not too close to the edges).
If the patch is not a close fit, use the drywall knife to widen the angled paper edges, to make room for taping. A fiberglass mesh tape is best for this, and will hide better if the painted paper is peeled/carved from under where the mesh will be placed.
If the patch is a close fit, skip #6 and begin the fill : the gaps can be filled directly with goop (drywall mud). Expect to do several layers (especially if mesh is used). First push the mud into the gaps and let it dry, then put a second layer. Finally, a third finish layer.
Apply mud with a wide, fresh edged drywall tool . Use the tool (and a damp rag or sponge) to keep the mud fairly smooth for the first layers as you are applying. For the finish layer, carefully smooth out the finish (don't forget to also mud your nail heads on the patch during the first round). 


Most people apply the several layers of mud, then use sandpaper to smooth out the fix, leaving a smooth flat fix in a textured wall. I generally use a wet rag or sponge during the process to keep the extra cleaned up as I go. If the wall is textured, a rag or sponge matching the texture is helpful to re-create the texture of your fix. After the final layer is applied, press the sponge or rag gently onto the patched area to leave a matching texture!

Be patient : let each layer of mud dry. Also, be patient : don't try to paint before the entire project is thoroughly dried, or you will wreck your beautiful work!  Use a primer on the newly mudded area before applying the matching paint.