You can also find upholstery foam in different shapes, but usually for interior furniture, rectangular or square shapes are best, as opposed to wedge shapes.
To cut your foam, they do make a foam saw that makes cutting foam easy and efficient, but if you are just starting out, don’t worry! There are other options you can use that you probably have laying around your house. Foam can easily be cut with a large sharp knife, or Electric carving knife (Yes, I mean the common kitchen item for carving turkey!)
For more complex shapes and layering, you can use spray adhesive to bond two pieces of foam together to make it thicker. You can also spray adhesive to attach cotton padding or upholstery batting to the foam to make cushions and headboards softer and more rounded.