Install rigid foamboard to exterior walls over wood sheathing, either plywood or oriented strand board (OSB). Place panels vertically -- most are sized to fit the wall length -- and nail in place with galvanized roofing nails with 3/8-inch heads. Drive nails through the foamboard to penetrate the framing at least an inch. Space nails about 24 inches apart aligned with interior wall studs. Cut panels as needed with a utility knife and straight edge. Use tongue and groove connections if provided.
Place rigid foamboard over roof decking in similar fashion, but use panels with a vapor barrier, typically some type of metallic shield, placed down on the decking. Cover the entire roof, from eave to peak. Overlap panels at the peak, with one side extending over the edge of the other side. Install shingles over the foamboard.
Seal all foamboard seams or joints with tape, matched to the type of foam board. Use tape from the same manufacturer as the foamboard, usually about 2 inches wide. Wrap exterior walls covered with foamboard with some type of moisture-proof house wrap, typically a thin polystyrene sheet, stapled over the foam board. Seal the seams of this wrap with tape, too.
Choose a type of foamboard and a thickness to fit your job. EPS and XPS are most commonly used on exterior walls in thicknesses of about 1 1/4-inch. Match the foamboard to the climate and building -- some extreme cold conditions require foam board up to 4 inches thick.
Add interior insulation inside a house with foamboard sheathing, using either interior foamboard or other material, like fiberglass batts. Place interior insulation between wall studs or roof joists.