Flip your rug over so that the bottom is facing upwards. Pull the rug tight and align the torn sides.
Nail each side of the carpet down using a tack or shallow nail.
Sew the edges of the rug together using a rounded upholstery needle and mono-filament or another thread. Choose a thread color that matches the dominant color in the rug. In order to avoid unnecessary strain on the seam, use a fairly wide stitch of 1 to 2 inches.
Double back over the stitching at the end of your seam. This secures the seam.
Fluff up the fibers of your carpet with your hand to cover the repaired area.
If your rug is a braided, remove the loose thread. Then use a rounded upholstery needle to sew the braid back together.