Locate the circuit breaker box. Shut off the breaker(s) that supply electricity to the room you're going to be working in.
Unscrew the electrical outlet cover with a screwdriver. Remove the screw and the cover. Place the screw on the cover so it doesn't get lost.
Inspect the spaces between the electrical box and the wall. If there are wide gaps between the box and the wall, you'll need to insulate the outlet with foam. Thin gaps can be closed with caulking.
Spray foam or apply caulking between the wall and the outside edges of the box to close the gaps. Wipe off any excess insulating material with a rag.
Place a cut-out foam gasket over the electrical box so the sockets are completely exposed. The gasket should cover the open area in the box and around the outlet to insulate it.
Replace the cover over the electrical box so the holes in the cover fit over the sockets. Align the hole in the cover with the screw hole underneath. Screw the electrical outlet cover back into place. Turn the electricity to the outlet back on.