As shenrie says above, "typical" foam comes in two different ratings. You can choose which of either you want to customize your application.
First is density. This will be in the form of 2lbs. per cubic inch or something like that. The denser the foam, the more expensive and the more long lasting. You know how sometimes there will be a piece of heavy old foam that just doesn't die? High density is why. Basically, the higher the density, the more "foam in the foam."
Second is firmness, usually measured in "ILD" (something like indentation load deflection). These numbers usually from something like 18, which is super soft; to something like 50, which is very very firm.
I've specced foam for quite a few camper/beds over the years, and since it's hard to know for sure until you use it for awhile, I hedge my bets by ordering more/different/thinner layers that I can rearrange to sllghtly customize it (and/or replace one thinner cheaper layer if I got it too wrong). Typically, buying two 1" pieces is about the same price as one 2" piece, so there is not much penalty. And if you have the layers covered, they tend to stick together.
So say I wanted a 4" bed/couch. Off the top of my head I'd get at least 2 lb. foam (if not 3lb), then 1" of 50, 1" of 35, 1" of 25, and 1" of 18 ILD. Or something like that. You get the idea anyway. Thus a 4" bed that I can shift around the layers to adjust the feel (and or replace one with something else if I went too far wrong).
All that said, I might not get "regular" foam these days. I'd probably look into latex. And I now really like topping any bed/couch with a ~2" self-inflating camping pad. These are brilliant, super long lasting, and allow instant customization of firmness by letting out a bit of air, or adding a puff or two. And in a pinch you have a camping pad, or something you can thrown down on the floor for an extra guest, or throw down on someone's spare room floor to avoid the hide-a-bed
So now I'd get something like 2-3" of firm foam, plus the camping pad "topper." REI makes good ones, or there is the Thermarest brand. They are nothing like an old air mattress, btw.