I am not too particular with this part of the process, but others are. Look around, and you will see many different ways knitters weave in their tails. For instance, Purl Bee has some excellent weave in methods - I am just usually too lazy to be so particular.
Here is how I do mine - usually with a crochet hook, I just weave in and out along the cast on and bind off edges. If I am feeling ambitious, I will break out the yarn needle and carefully weave along the stitch pattern. Other times, I will just weave along the edge as I would with a crochet hook. Sometimes, I work right under the edge. Any way you do it, if it looks good to you, then don't worry about it. There is no wrong way to do it :0)