Cut drywall patches to fit the space on each side of the new outlet box and attach them to the 2x4 support with drywall screws. Tape the seams with mess tape and cover the whole thing with joint compound and smooth it out. Apply several coats to build up a smooth finish that can be sanded and painted to touch up.
Use a straight edge held flat against the top of the base cap to keep your line straight as you pull the knife through the caulk several times until it’s cut cleanly.
Press a small board against the bottom of the outlet box to hold it flush with the ceiling while attaching the support assembly to the joists. Working through the channel, drive deck screws or nails through the holes in the metal hangers and into the joist. Use four screws on both ends of the support, two on each side of the hangers.
When running new wiring pay attention to the amp rating for the circuit you are extending. For a 15 amp circuit use 14 awg (american wire gauge) cable, for 20 amps use 12 awg, 30 amp: 10 awg, 40 amps: 8 awg, 50 to 60 amps: 6 awg. Most lighting and receptacle circuits will be 15 amps and make use of 14/2 or 14/3, but some of these circuits may also be 20 amps, so be sure of the rating and use the proper cable and devices for your project. Depending on the gauge and box depth, there is a limit to the number of wires allowed inside an outlet box. If adding new ones would force exceeding the limit it may be possible to add a junction box to the circuit.