Rim the edge of a margarita glass with a lime wedge and dip it into salt or sugar, if desired.
Fill a cocktail shaker with ice.
Add tequila, cream of coconut, lime juice, and triple sec.
Shake vigorously for about 15 seconds until well chilled.
Strain into the prepared glass over fresh ice.
Garnish with a lime wedge and toasted coconut flakes.