Thinly slice the red onion into ⅛-inch slices. Peel the garlic. Place the onion and garlic in a large glass or ceramic bowl.
Add the sugar, salt, and peppercorns to a small sauce pot. Add the vinegar and whisk until most of the sugar and salt are dissolved. Place a lid on the pot and bring the mixture up to a boil over medium-high heat.
When it reaches a boil, pour the vinegar over the sliced onion and garlic.*** Press the onion down so all the pieces are submerged, then let the mixture cool to room temperature. I sometimes place a piece of plastic wrap over the onions to help push them down and hold them below the surface of the brine (see the step-by-step photos below).
Once cool, use the onions immediately or transfer the onions and all the brine to a covered non-reactive container (glass, ceramic, or plastic) for storage in the refrigerator. The onions can be stored in the refrigerator for 3-4 weeks.
*Although you can omit the sugar in this recipe, I don’t recommend it. Since I use white vinegar, it has a tart, harsher bite. The sugar helps cut the bite and balances the flavor. If you want to omit the sugar, I suggest using a milder vinegar like apple cider or rice vinegar.**White vinegar is great for pickling onions because it's budget-friendly and easily accessible. It has a clean, neutral, and sharp acidity that amplifies the onions' natural colors. Because it is clear, it also leaves the pickling liquid bright and doesn’t muddy the vibrant pink of the onions. I only ever use white vinegar in this recipe. However, you can use different kinds of vinegar to change the flavor, if desired. I suggest avoiding vinegar with strong flavors, so they don't overpower the onions or other ingredients. Try rice vinegar, white wine vinegar, red wine vinegar, or apple cider vinegar!***For onions that remain crunchy, pour the boiling vinegar over the onions in the bowl. If you prefer soft onions, add the onion and garlic to the sauce pot and allow them to boil in the vinegar for 1-2 minutes before transferring to a non-metal bowl to cool.Make them spicy: Add ¼ teaspoon red pepper flakes to the brine. For a spicier batch, use ½ teaspoon. You can also add a few slices of fresh jalapeño for more pepper flavor.Choose the right storage container: It's best to store your pickled red onions in an airtight glass or ceramic jar. Glass, like a mason jar, is a great choice because vinegar is highly acidic and will react with metal or stain/absorb into plastic. Be careful, though, because metal lids will corrode or rust when exposed to vinegar over time. I suggest glass or enamel-coated lids.