Place a fine-mesh sieve over a medium bowl; set aside. In a medium saucepan, off heat, whisk together sugar, cornstarch, salt, and cocoa powder. Slowly (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 the first large bubble forms and sputters. Reduce heat to low; still whisking, cook 1 minute. Remove from heat; immediately pour through sieve into bowl. Stir butter and vanilla into hot pudding.
Press plastic wrap directly on surface of pudding to prevent a skin from forming; chill at least 3 hours or up to 3 days.