What I usually do:
Thread a big yarn needle (you can find them in the craft section) with a piece of yarn. How long depends on how big the hole is. If you don't have more of the yarn, you may be able to steal a piece of fringe, or, if that doesn't work, you may have to get the closest match you have.
Lay the work out flat and look at the way the yarn runs up to the hole. Take the new yarn, punch through the yarn in the scarf with it an inch or two from the hole, and follow the yarn already in the scarf along its path through stitches until you get to the hole. Depending on what made the hole, you may want to just go across or you may want to run the yarn through the rows above and below the hole as if it were a stitch, Go on across the hole, in any case, and copy a few more stitches, run the needle yarn through the scarf yarn in a couple of places, and clip it off.