Sift and whisk sugar, cocoa powder, cornstarch, and salt together in a saucepan; heat over medium heat.
Slowly pour in milk, whisking constantly until incorporated. Cook, stirring often with a metal spoon, until pudding is noticeably thicker and clings to the spoon, about 10 minutes. Off heat, stir in vanilla extract.
Divide pudding among 4 small bowls; serve immediately or chill in the refrigerator at least 2 hours.
