I have found that the best way to keep the elastic straight and exactly where you want it to be while sewing is to baste it in place with a needle and thread. Take a needle and do running stitches to baste the elastic to the waist band of the shirt.
The best way that I have found is to use pins to hold the elastic in place. try not to stretch the elastic to much or it will not work when you go to sew it. then, slowly sew it in place.
Sew a seam big enough to fit the elastic through and leave the ends, then put a safetypin at the end of the string of elastic and push through manually.
Make a zigzag stitch over dental floss where you want the elastic to be. Gather the material, pulling on the floss or thread. Sew the elastic on top of this.