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