If you have a box that is too far in the wall, a quick fix is a box extender. These are box-shaped rings that vary in size and are placed over the existing box face to flush the face out with the wall. You probably have encountered an electric box with a switch or outlet that is set in too deeply to allow a cover plate to be installed. Or maybe the switch or outlet wasn't secured tightly because the box is set back too far. By using these rings, you can have a flush finish without having to remove the old box and replace it with a new one.
The first step to install a box extender is to turn off the circuit that you'll be working on. Then simply remove the switch or outlet and slip the ring over the device. It is likely that you'll need longer 6/32 screws to reattach the device, due to the added thickness.
Generally these box extenders come in a plastic model, but there are metal box extenders available. So the next time you have an electrical box too far in the wall, don't use nuts, tape, cardboard, or chewing gum to flush out a device, use a box extender...You'll be glad you did!