To do this on your own, buy switch and receptacle boxes that meet local codes and are large enough for the wires they hold. It’s easy to underestimate, so buy extra supplies. At the same time you install boxes, attach fans, lights, or other fixtures that need to be hardwired. Local codes specify where cable should run and at what height to place receptacles and switch boxes. Check codes before you begin. Project tip: If desired, use a mud ring to attach the box. Adapter rings, also called mud rings, are typically 1/2 inch or 5/8 inch thick. Choose a ring that matches the thickness of the drywall or paneling you install. Attach the box flush with the front edge of the framing member, then add the ring.