Unzip the cushion and remove all the stuffing.
Turn the cushion inside out and look for the stitches holding the zipper in place.
Remove the stitches with a seam ripper. Be careful not to tear the fabric.
Verify that the new zipper's size is the same as the old zipper. If the new zipper is longer, cut it from the bottom so the zippers are the same size.
Pin the new zipper into place.
Sew the zipper into position, removing the pins as you go.
Finish off the zipper by sewing a straight stitch 1/4 inch from the zipper teeth.