Place the shallots, wine and vinegar in the pan and bring everything up to a simmering point.
Then cover with the lid and let it simmer very gently for 25 minutes. After that time, turn the shallots over in the pan and add the garlic, poking it down into the liquid between the shallots, then continue to simmer uncovered this time, for 30 minutes. After this time check the shallots are tender with a skewer and if they are not give them a little longer, then sprinkle in the sugar and increase the heat a little for a final 10 minutes, so the juices have reduced to a glaze that coats the shallots.
Taste and season if necessary. If it's more convenient, the confit can be made ahead and reheated gently before serving.
You will need a lidded, shallow pan with a base measurement of about 24cm