First, locate the existing framing that supported the old electrical box. This will be the mounting point for the filler piece of wood to which the drywall patch will be secured. Measure the depth and diameter of the existing hole to determine size of filler piece.
Cut a piece of scrap wood that is 1/2" thinner than the opening to allow for the thickness of drywall. You'll also want to cut the piece a little smaller than the opening. Use screws (or adhesive) to attach the scrap piece of wood to the framing piece.