Apply anti-fray product around the edges of the rip. Let the edges dry completely so they become solid. Thread a needle with about 2 feet of buttonhole thread and tie a knot in the end.
Start sewing about 1/8 inch below the rip. Sew the first few stitches below the rip to provide some tension allowance. Sew the stitches laterally so that part of the needle stays on the surface of the sofa at all times.
Sew together the edges of the rip. Pull the thread taught after each stitch but make sure the fabric does not wrinkle. Sew up the entire rip and about 1/8 inch past the other end.
Snip off the excess thread to release the needle. Let the end of the thread slip under the sofa fabric. The extra stitches will keep your work in place.