Put the water and sugar to boil in a pot on the stove - you need to get a sugar syrup.
To see whether it's ready, put a drop of the syrup in ice cold water - if the drop stays as it is, it means it's ready.
After it cools a bit, add the cocoa and stir. Stir until the chocolate mixture homogenizes.
Put the container back on the stove until it boils. Add a piece of butter. Remove from the stove and stir so that it cools a little.
Pour this now cooled glaze over your cake or pie.
If the glaze thickens too much during boiling, you can dilute it with a little milk.