Darning is traditionally used hand stitches to repair holes or tears on fabric when not close to the seams. Darning is sewn in such a way that you are “replacing” the damaged fibres with new fibres by stitch backward and forward and then left and right.
The same idea is used when using a darning foot; you use your sewing machine in the same way as traditional hand stitches to close and secure those holes.
The darning foot is unique in that it it’s presser foot is spring-loaded; it stitches downwards like normal, but when the needle is raised so is the presser foot – even when the presser foot lever is lowered.
Ideally you should stretch your fabric in an embroidery hoop so that it is taught, and then sew in a cross hatch pattern across the holes. Of course use a colour matching thread. You can use this foot with your feed dogs either up or down, though some people prefer them down for easier guiding.
The darning foot is very commonly confused with the free-motion embroidery foot. The two can easily be told apart: the darning foot has a closed toe, whilst the embroidery foot has an open toe. You cannot use the embroidery foot as a replacement to the darning foot as the open toe will catch the frayed fibres and cause snags.