Mix cocoa powder and sugar in a bowl.
Gradually add milk while stirring well.
Melt butter in a pot and add the mixture.
Cook over low heat, stirring constantly, until thickened.
Turn off the heat and mix in vanilla extract.
Let it cool, then store in a glass jar.