Add the sugar and water to a heavy-bottomed saucepan and heat on medium.
Stir continuously until the sugar is completely dissolved. Remove from heat.
Allow the mixture to come to room temperature before adding the vanilla extract and transferring to an airtight container.
Notes
It is important let the mixture cool before adding the vanilla because you can cook away the subtle notes of the extract if it is exposed to heat too long. To use vanilla bean pods, scrape out the seeds and stir it into the sugar before you add the water. Add the scrapped pod into the saucepan with everything and let it infuse into the syrup as it cooks. You can keep the pod in the syrup as long as it stays completely submerged in the syrup.