Drain the pearl onions, slowly caramelize the sugar in a saucepan; when it is nice and golden brown, deglaze with cola and simmer until the sugar dissolves again.
Add the garlic with a few squirts of Tabasco (if you like) and finally add the pearl onions.
Let everything simmer for about 15 minutes until the liquid is reduced to about half.