Measure width, depth and height of existing sofa cushions.
Shop for new sofa foam. This is widely available at fabric and craft stores and at upholstery shops. Pay careful attention to the foam's thickness. This is especially important if you're reusing the existing upholstery.
Remove the old sofa foam from upholstery and place on top of the new sofa foam to use as a template.
Trace around the old sofa foam with a permanent magic marker.
Plug in an electric carving knife. This is the same kind of knife many use to carve ham or turkey.
Cut around the magic marker outline. It's a good idea to cut slightly outside the outline, especially if the old cushions were extremely worn. It's always possible to trim more foam off if necessary, but impossible to add if too much is cut off.