Locate the darning stitch on your sewing machine. Set up the machine to sew along the hole in the sock. You only need to push the pedal and the machine will sew back and forth, stitching along where the fabric has weakened.
Use a straight stitch if your machine doesn't have a darning stitch. Start at the base of the hole and sew in a forward direction. Stitch to the top of the hole and stop.
Reverse the stitch and sew in a backward direction, slightly moving toward the right. Stop when you reach where the hole ends and again reverse the stitch. Keep stitching backward and forward, each time moving slightly farther toward the right. Continue until you have completely covered the hole.