Lay out the foam mattress on a protected working surface. Cut the mattress into three or four even sections, depending on your mattress size and desired ottoman shape, making sure the sections are even by measuring them.
Sew a fabric sleeve with the exact width and depth of the mattress that is two feet longer than the mattress was originally and has all seams hidden inside. Leave the sleeve open on one of the small ends only.
Slide the first mattress piece into the sleeve and push it up to the very end. Sew it in place with a row of horizontal stitching as close as possible to the mattress piece. Leave five inches of space and sew another row of stitching. Slide the next piece of mattress into the sleeve and continue this process until all the pieces have been used up. Cut off any excess fabric. Sew the final piece in place with a row of stitching or hand sew it for a more attractive appearance. Stack the pieces on top of each other in an alternating way to transform the bed into an ottoman.