I know that the seat cover makers ask you to cut out the bad foam and add a block of foam and the carve it to shape, but I have found an easier way. Foam in a can. The Dow window and door foam spray is flexible and is perfect for this use. Use the stuff in the blue can only because everything else is rigid. My seat foam had gouges in it from the weather. I sprayed it and allowed it to cure. Then I carved it with a knife to the correct shape. The first attempt had voids because I sprayed twice about 10 minutes apart. But I resprayed after carving to fill the gaps. I found that smashing the foam to about the right shape with a plastic bag was helpful I then installed the new cover and the seat looks good.
I took pictures, but I can't figure out how to post them