Whisk the dry stuff: sugar, cocoa powder, cornstarch, and salt in a bowl until there are no clumps. Don’t skip this step; clumps are not your friend here.
Warm the milk: in a saucepan over medium heat, gradually heat the milk until it’s hot but not boiling. Tiny bubbles around the edges are a good sign.
Combine and simmer: pour a little hot milk into the dry mix to make a smooth paste, then whisk it back into the pot. Keep whisking as it thickens—this is where the magic happens.
Thicken and finish: cook until the mixture coats the back of a spoon and you can draw a line with your finger. Remove from heat, stir in vanilla and butter if using.
Chill or serve warm: decide if you want a warm dessert or a chilled, pudding-cold bite. Either way, you’re golden.