Measure the length of the pipes in your attic with a measuring tape. Add all the measurements together to get the total length of foam insulation you will need for the pipes.
Wrap the measuring tape around the pipes to determine their width. Do this with any pipes of varying diameters.
Purchase the correct length of self-stick foam pipe insulation in the correct diameters. This type of pipe insulation has a premade cut along its length so you can easily wrap it around the pipe. It then seals shut when you remove the tape cover. It comes standard in a 3/8-inch thickness, but you can select thicker insulation if you live in a particularly cold climate.
Open the length of the pipe insulation along the premade cut, and wrap the pieces around the appropriate lengths and widths of pipe based on your earlier measurements. If your pipes bend, use a sharp knife to cut the insulation to the right length. If the pipes meet at angles, use a sharp knife to miter the edges, or cut them at angles so they meet over the pipe joint.
Secure any mitered edges with foam tape.
Remove the tape covering the sealant on the pipe insulation and press the edges of the insulation together to create the seal.