I have a friend who wears holes in the heels of her socks. Rather than throw them away I repair them. (We joke about her having a “lifetime guarantee”—she loves to wear the socks and I enjoy knitting them.)
It used to be I salvaged the legs and reknit feet. But that’s wasteful—the feet often have another season’s wear in them. So I changed to fixing just the heel—first I tried darning the hole but often the hole is too large for a successful darn. Next I tried knitting a patch over the hole, but the sides of the patch created a strain on the sides of the heel and she ended up with holes on the side. Sometimes I’ve reinforced the bottom of the heel with a double strand of sewing thread but where the thread ended on the sides left that area vulnerable.
The link above is to the complete set of directions (with pictures) showing how I replace just the worn heel of a knit sock!
If the hole is under the ball of the foot – no option, you can only really salvage the legs – ya gotta reknit the foot and of course by then you don’t have any of the original yarn left so you end up with something that contrasts well with the colours in the leg.