Yes. Styrofoam, which is the trademarked name for polystyrene foam, is a good insulator. Because it traps air in small pockets, it effectively reduces the flow of heat. Styrofoam is often used to insulate the wall cavities of buildings.