Bring 3 cups of water to a boil. Thinly slice the onions onto rings or half moons. Turn the heat off and add onions. Let them stand for no more than 1 minute, then drain.
In a jar (8-12 oz jar this a lid that closes tight) combine salt, sugar, garlic, black peppercorns and vinegar. Stir to dissolve. Add onions. Close the lid and let the onions come to room temperature, then refrigerate.
Onions taste best after at least 24 hours. Store in the fridge for up to 1 month.