1) The simplest way is to use a really sharp / sturdy Heavy Duty Utility Knife like an OLFA Ratchet-Lock Heavy-Duty Utility Knife. You can cut 2" XPS foamboard by cutting through half, and breaking the rest of the board on the edge of a table (it can create a cleaner cut, than trying to saw the foamboard with a Utility knife. But you can or may need to make multiple passes / cuts, depending on the thickness foam board thickness.
2) Use a flame (blow torch) to heat up blade of Utility Knife. This will make it easier to slice through the foam board.
3) Use Foam Cutter Electric Hot Knife
4) Use a Hot Wire Foam Board Cutter
5) Use a Closed Cell Insulation Trimmer
6) Use a Foam & Rubber Cutter
7) Use a Rope Cutter / Foam Cutter
8) Use an Insulation Knife
9) Use a Bread Knife or a knife similiar blade
Alternatively, if you don't mind pieces of foam all over the place when making cuts, you can use the following.
1) Table saw
2) Circular saw
3) Jigsaw
4) Hand saw