Put simply, foam is plastic that has been melted, had bubbles of gas forced into it, and then been left to re-form. This produces a cheap, soft, spongy material, which can then be sliced into specific shapes or simply minced up into pellets.
The kind of foam you’re probably familiar with is packing foam. Anytime you order something (or sometimes when you just buy it in a shop), it will come wrapped in a box surrounded by foam to protect it. This works because even relatively small amounts of foam are capable of taking the force of a large impact, preventing the object that is being protected from ever hitting a hard surface and being damaged.
Packing foam comes in many forms: sheets, pellets (‘packing peanuts’), blocks, and more. If you want some, the best thing to do is probably buy it from an office supplies store or, in larger quantities, direct from a supplier. If you have things delivered in packing foam often, then you might also consider re-using that foam – after all, while foam is disposable, there’s absolutely no reason not to use it more than once.
The other kind of foam that you might encounter at some point in your life is insulating foam. This foam might even be in your walls right now as you’re reading this article, without you even knowing it. The advantage of filling your walls with foam is that it can be easily squirted in through a relatively small hole, providing effective insulation without you having to do too much work on the wall. Like with packing, foam insulation is both cheap and effective, not to mention easy to use.