Place sliced onion in a large jar with a tight-fitting lid.
In a medium saucepan over medium heat, bring vinegar, water, sugar, and salt to a boil. Stir until sugar and salt dissolve. Add in red pepper flakes, if using, then pour mixture over onions.
Let cool to room temperature, then place lid on and refrigerate until ready to use, at least 2 hours. Onions will keep in refrigerator for up to 1 month.
