Slip your thumb under the shell to open and gently pull the shell back, lengthwise, starting at the head end. If desired, leave the tail “feathers” attached. (The tail is decorative and can be convenient to grasp when making dishes such as fried shrimp.)
Make a shallow cut lengthwise down the back of each shrimp to get to the vein, then rinse the vein out under cool, running water. If for whatever reason you don’t want a cut on the back of the shrimp to show, insert a sharp skewer underneath the vein at the middle of the back curve, and carefully lift it out. The goal is to lift it out in one piece, but it if breaks, make a second insert and repeat the process.