In a medium saucepan, whisk together the sugar, cocoa powder, cornstarch, and salt.
Gradually add the milk, whisking continuously to prevent lumps.
Place the saucepan over medium heat and cook, stirring constantly.
Once the mixture begins to thicken, continue to stir for 2-3 minutes.
Remove from heat and stir in the vanilla extract and butter.
Pour the pudding into individual serving dishes.
Allow to cool at room temperature for 30 minutes.
Cover with plastic wrap and refrigerate for at least 2 hours.
Before serving, whip cream for topping if desired.
Garnish with fresh berries or chocolate shavings.