Cut 5-inch-thick foam to the desired size, using your old cushion foam as a guide, with an electric knife.
Place the doubled fabric on a work surface and center the foam on top. Cut out two pieces of fabric that are 1 inch larger all the way around than the cushion for the top and bottom.
Measure all the way around the sides of the foam. Cut a strip of fabric to that measurement plus 3 by 6 inches wide for the side strip.
Take the circumference measurement and multiply that by three. Cut out 2-inch-wide welting strips along the bias of the fabric. Sew these strips end to end until you have a strip long enough to equal the previous measurement.
Make the welting by folding the welting strip in two lengthwise, enclosing the cording. Keep the cording as close to the fold of the strip as possible and sew down the entire length to secure it in place. Do not sew on top of the cording but right next to it.
Lay the top piece of the cushion on your work surface with the right side facing up. Line up the welting all along the raw edges. Hold in place with pins.
Sew the welting in place.
Pin the side strip for the cushion in place along the raw edges of the top of the cushion cover. Line up all the raw edges and pin in place. Sew to secure the two pieces of fabric together.
Repeat the process with the bottom piece of cushion fabric and the remaining welting. Sew around only three sides of the cushion when attaching the side strip to the bottom. Leave the back open for inserting the foam cushion.
Insert the foam at the opening. Work until the corners of the foam fit properly in place.
Fold under the open raw edges at the back. Sew the cushion cover closed using a needle and thread.