A cocktail shaker is used to mix the ingredients of a cocktail together. By shaking the ingredients with ice, the cocktail is chilled, diluted, and aerated. This process helps to blend the flavors together and create a smoother, more enjoyable drink.