Darning socks is very difficult, especially if you want your socks to remain comfortable. Never ever start off with a knot on your thread.
Cotton thread works well for light and medium weight socks; embroidery thread works best.
For heavy wool socks, two strands of strong woolen yarn (or mending yarn or scrap yarn, as it's sometimes sold) work well because they stay in the wool fabric better.
First surround the weakened area to limit its expansion.
Use a horizontal running stitch to mark the area.
Then, fill in the surrounded area with a vertical, weaving-type running stitch.
If you have a gaping hole with no cloth grid, your horizontal lines will just be the thread, laying straight across the opening.
Make sure you aren't sewing the stitches too tightly. You can prevent this by putting your sock over a light bulb and pulling very slightly.
Continue weaving, up and back across the hole, keeping the stitches parallel.
Make the thread go in and out at the end and cut it. Do not tie a knot.