In a medium saucepan, off of the heat, whisk together sugar, cornstarch, salt and cocoa powder. Very gradually (a few tablespoons at a time) whisk in milk, taking care to dissolve cornstarch. Whisk in egg yolks.
Whisking constantly, cook over medium heat until it starts to bubble slightly, this will take longer than you think, up to 15 minutes.
Remove from heat then immediately stir in butter and vanilla.
Divide now or later. If you do not want a skin on the pudding place plastic wrap directly on surface of pudding.
Chill for 3+ hours. If you did not divide the pudding simply whisk it and divide when ready to serve.