Peel onion, remove ends and chop finely.Place in a clean or sterilized jar. Pour vinegar, water, sugar and salt into a saucepan and simmer until dissolved.
Add the garlic and pepper, then pour the hot mixture over the sliced onion in the jar.
Close the lid and leave to cool to room temperature.
Store in a cool place.