Combine the water, sugar, lavender buds, and butterfly pea flowers, if using, in a small saucepan.
Bring the mixture to a gentle boil over medium heat, stirring until the sugar is fully dissolved.
Remove the saucepan from the heat, cover it with a lid, and let the mixture steep for 15 to 20 minutes to infuse the flavors and color.
Pour the syrup through a fine-mesh strainer into a clean jar to remove the botanicals, then let it cool completely before use.