Fiberglass insulation does not do a good job of suppressing air leaks around fixtures. Seal around junction boxes using caulk. These fixtures often have holes with or without wires running through them. Seal the holes and spaces around wires with caulk as well. A good-quality latex or silicone caulk stops air infiltration and dries flexible so it can expand and contract with temperature changes.
Apply fiberglass insulation over the top of junction boxes -- the portion extending into the attic, wall or floor joist bay. Envelope the sides of the box with insulation as well. Avoid compressing the insulation by stuffing it around the box. Once fiberglass insulation loses its loft, its R-value decreases. That value represents how well insulation materials prevent the migration of heat toward colder air.
The North American Insulation Manufacturers Association recommends cutting away sections of insulation so the fiberglass fits snugly all around the junction box. A snug fit is not the same as a compressed fit. While some insulation is removed, the remainder retains enough loft to keep most of its R-value. Trim the piece with a utility knife. Wear personal protective equipment -- gloves, safety glasses, dust mask and long-sleeved shirt -- when handling and cutting fiberglass insulation. Fiberglass particles can become airborne and are an irritant.
The National Electrical Code restricts insulation around recessed lighting. This may be a factor if such lighting is installed near junction boxes, particularly in ceilings where recessed lighting is most common. The code requires insulation materials be kept at least 3 inches away from recessed lighting, and that no insulation be placed on top of recessed lighting fixtures, unless the fixture is specifically rated "IC," for insulation contact. This requirement is to allow free airflow around the fixture and avoid trapping heat with insulation materials.