Add the vinegar, sugar, and salt into a medium sauce pan - stir while bringing it to a boil. Remove from heat. While it is cooling, prepare the onions.
Peel and slice red onion into thin ½ moons (I cut them in half again but consider what you will use them for and cut accordingly). Place them in a clean jar or two (you can push them down gently to fill the jar). Add the garlic cloves, black peppercorns, and a pinch of red pepper flakes if you want to bring a little heat to your pickled onions (this is optional).
Pour the brine over the onions in the jar. Let cool, add the lid, and put in the fridge. These pickled onions can stay in the fridge for up to 6 months (but they won't last that long).
PRO TIPS: I peel but keep the garlic cloves whole. The size of the cloves and how garlicky you like your pickles will determine how many cloves you add. I take my garlic out after the first day. Add peppercorns to taste. Depending how peppery you want the onions, add more or less whole peppercorns.