Begin by reading the ingredients and instructions thoroughly. Measure all ingredients. Combine sugar, cocoa powder, corn starch, and salt in a heavy saucepan. Whisk them together until fully mixed. Keep the butter and vanilla close to the stove for easy access later.
If you notice clumps after whisking, they are likely from the cocoa powder. Use the back of a spoon to break these clumps.
Slowly pour the milk into the saucepan while continuously whisking.
Place the saucepan on low heat and continue to whisk. The pudding needs to thicken gradually, which will take about 10 minutes. Do not increase the heat to speed up the process, as this can prevent proper thickening and result in a watery texture.
Once the pudding starts to thicken, it will do so quickly. Large bubbles will form and burst on the surface. Continue whisking for another minute after it begins to boil.
When the pudding is thick enough to coat the back of a spoon, remove it from the heat. Add the butter and vanilla, whisking until they are fully incorporated. Pour the pudding into 4 dessert cups, or into a graham cracker or pie crust if desired. Press plastic wrap directly onto the surface of the pudding to prevent a skin from forming. Refrigerate for about 2 hours until chilled. Serve with whipped cream if desired.