Cut a plain-colored lightweight fabric into two rectangles of the desired pocket size. Determine dimension by comparing the fabric with your garment to make sure the pocket is big enough to fit your belongings and to insert your hand into it.
Pin the two rectangles, right sides facing each other, so that the edges are all aligned. Sew three of the four sides with a 3/8-inch seam allowance, leaving the entry point open. Leave the pocket as is if you don't mind having the stitching inside your pocket. Start with the wrong sides facing each other, sew the three sides, turn it inside out, press along the edges with an iron while the wrong sides face each other, and sew the three sides again for a clean stitch inside your pocket.
Press the top edge of your pocket by folding in half an inch. Sew along the edge of the pocket with a 3/8-inch seam allowance. Repeat for cleaner edges, or leave it as is if you're satisfied with the result.
Turn the newly created pocket inside out so that the right side faces outward. Press the pocket with an iron, and make sure the corners are completely turned inside out. Use the tip of knitting needle or crochet hook to press it out.
Pick a spot inside your garment where the pocket will go. Pin the pocket in place using pins.
Sew the back side of the top of the pocket to your garment with a slip stitch. Make sure to only stitch through the lining in jackets and vests, or take as little as possible of the exterior fabric of pants or garments with only one layer of fabric.
Sew the side and bottom of your pocket using the a slip stitch to create barely visible stitching. Skip this step when you are sewing your security pocket to the inside of pants, if the top of the pocket is sewn onto your belt area and your pants are made of a lightweight fabric.