Step 1: You can find piping in the fabric store (near the bias tape) or make your own by wrapping cord in your favorite bias tape. The piping should have the cord sewn in between the bias tape, with the ends of the tape flat and ready to be attached to your garment.
Step 2: Piping should be attached into a garment's seam. To do this, place one of your garment pieces face up, and the piping on top of it, matching raw edges. Then, using a zipper foot, baste the piping to the garment seamline, stitching as close to the piping as possible.
Step 3: Place the other, corresponding garment piece face down on top of the the first, sandwiching the piping in between. Stitch the seam closed using your zipper foot, again sewing as close to the piping as possible.
Step 4: Turn your garment right side out. You should have a beautiful piece of piping running down the seam, with no visible stitching lines showing through to the outside. If some of your basting lines are still visible, or the piped cord is not as close to the seam as you would like, simply turn the garment back over and stitch down the seam again, even closer to the piping.