I usually use a crochet hook to pull the loose tail through, but most people use a tapestry needle, the same you'd use to sew up seams. Beginning on the other side of the sts from where your tail is, run the yarn through the sts like a drawstring. I usually do it twice or you can just do it once, then through only a few more sts a second time. Fastening it is just weaving the end through like you do with regular knitting.
There's a video for picking up sts at the bottom of the Tips page. Hold your piece in the L hand as if it were a needle and using the R needle 'knit' into the sts along the edge.
sue- knitting heretic