Heat the milk and butter together in a medium-sized saucepan over a gentle heat until the butter has melted. Set aside 4 teaspoons of sugar and stir the rest into the pan until dissolved.
Meanwhile, place the cocoa, cornstarch, and 2 tablespoons water ina small bowl and stir well to make a smooth paste.
Pour the paste gradually into the saucepan, whisking constantly. Continue to whisk while you increase the heat to high and cook until thick and bubbly, about 5 minutes. Remove the pan from the heat and stir in the vanilla extract.
Spoon the mixture into 4 ramekins or small glasses and sprinkle a teaspoon of the reserved sugar over each one (this prevents a skin from forming). Leave to cool, then cover with plastic wrap and chill in the refrigerator for about 4 hours until set.