I know the polystyrene you get with electrical appliances is no good because i creates those really annoying balls.
The trick is to cut this type of foam with a sharp kitchen knife, something like a thin one used for cutting meat, and use long but careful back-and-forth strokes. Done right, you’ll cut the little foam balls in half instead of pushing them out of the material, which is what makes the mess. Yes, there will still be some lying about, but nowhere near as much as when you go hacking at the material with a bread knife (which is what Games Workshop used to recommend …
).
A more expensive alternative is a tool used for laying underfloor heating:
This is one I used ages ago, borrowed from my next-door neighbour when he was putting such heating into his home, and I think he had it on loan or rent from the company where he had bought the necessary materials. Anyway, it’s basically a heated knife that will cut through polystyrene foam very well and leave no mess at all.
There are also tools that look a bit like a jigsaw but with a heated thin wire, which also work very well but you need to be careful you don’t snap the wire. I have one my father built for me almost forty years ago from a block of wood, two bicycle spokes, and a 12 volt transformer
Apparently, you can make one from a 9 volt battery.
Also where do you buy your foam from?
DIY stores. Plates 50 × 100 cm in size are available in all kinds of thicknesses, and cost very little.