Foams can be cut mechanically using a band saw fitted with a fine-toothed or toothless blade.
Foam with a thickness of 20 mm to 30 mm can still be cut very well with sharp scissors. However, if you want to cut thicker foam, you will achieve very good results with an electric carving knife. The two counter-rotating blades cut the material very precisely and cleanly. If you do not have an electric knife to hand, you can also use a conventional bread knife. The bread knife should have a serrated edge. Cutters or carving knives with a smooth blade are not recommended, as the knife quickly becomes blunt and you end up with frayed edges. A little vegetable oil on the recommended knife blade helps to make the cut a little easier.
Another possibility:
To ensure a "clean" cut, it is advisable to press the foam to "0" with a ruler and then cut through in one go with a sharp cutter.