There are two main categories of cocktails: stirred drinks and shaken drinks. The way you make a cocktail depends on its contents.
Add all the drink ingredients to the smaller cup or mixing glass. Add ice to the larger cup until it’s about two-thirds full. Hold the larger cup in your nondominant hand. Invert the smaller cup over the larger one at a slight angle, pouring the drink ingredients into the ice as you do. Give the smaller cup a firm tap so that it forms a tight seal with the larger one. (You should be able to lift the whole shaker by the smaller half without the apparatus falling apart.) Shake vigorously, using the grip you find most comfortable. For beginners, it may be easiest to grip the shaker at either end, holding the bottom with your nondominant hand and the glass or top cup with your dominant hand.
In many cases, you’ll be able to unseal the shaker by simply wiggling the top cup back and forth. But if you’ve got a very tight seal, grip the bottom half of the shaker with your nondominant hand and, using the heel of your dominant hand, firmly tap the bottom cup just under the junction where the two halves meet. (You may have to do this more than once.)
Once the shaker is unsealed, remove the top half. Fit a strainer into the bottom half and decant the drink into the glass, using your forefinger to hold the strainer in place as you do.