Inspect the area on and around the roof rafters for exposed wiring or leaks and repair them.
Calculate how much foil you need by multiplying the length and height of the underside of the roof and dividing that number by the size of the foil sheets.
Measure the distance between the roof rafters and add 4 inches to that length, then cut sheets of foil to fit those dimensions. You add the extra 4 inches because you want each sheet to overlap along the edges by 2 inches.
Install the first sheet along the top edge of the roof on one side with the help of an assistant. Position the sheet so that 2 inches on the edge overlap with the corner of the wall and do not cover the ridge vent that runs along the peak of the roof. The heat will be reflected out of the attic through the ridge vent. Staple the foil to the rafters every 4 inches.
Place the second sheet into position so that the last 2 inches of the first sheet and the first 2 inches of the second sheet overlap and staple the foil to the rafters.
Continue installing the foil across the top of the roof, then install foil beneath it until you reach the attic floor. Overlap every edge of the foil sheets by 2 inches when installing them. If you need to cut the foil to fit it around vents or ducts, cover the cuts with foil tape.