Along with polystyrene foam

Small gaps for normal ventilation should be left along the walls.

If you plan to mount the carpet, then as an additional insulation, along with polystyrene foam, you can use sheets of plywood, chipboard, etc.