Combine the ingredients. In a small saucepan over medium heat, combine 2 cups of blueberries, 2 to 3 tablespoons of sugar (to taste), 1 tablespoon of lemon juice, 1 tablespoon of water, and lemon zest if using. Stir gently to combine.
Simmer. Bring the mixture to a simmer and cook for about 10 minutes, stirring occasionally. The berries will burst and release their juices, creating a syrupy sauce. If using frozen berries, they may need a minute or two longer to fully cook down.
Thicken. If you prefer a thicker compote, mix 1 teaspoon cornstarch with 1 tablespoon of water in a small bowl. Stir the slurry into the compote during the last few minutes of cooking. Let it simmer for another minute until thickened.
Add vanilla. Turn off the heat and stir in ½ teaspoon of vanilla extract for added flavor.
Cool slightly and serve. Let the compote cool for 5–10 minutes. It will continue to thicken as it rests. Serve warm or chilled.