Covering a Window with insulation
You could, but getting the foam to fit right and seal won't be easy. The easiest is a plastic window covering. They make some that you shrink with a hair dryer after installing. This will ensure a seal.