Put 1-½ cups of the milk, the sugar, and the cocoa in a nonreactive saucepan. Bring to a simmer over medium-high heat, then remove from the heat.
Meanwhile, whisk the remaining 1/2 cup milk, egg yolks, cornstarch, vanilla extract, and kosher salt.
Gradually whisk the hot milk into the egg mixture. If you try to incorporate too fast, you will have scrabbled eggs. Do this step slowly.
Add mixture back to the saucepan and cook over medium-high heat, whisking constantly, until the pudding comes to a full boil. Reduce the heat to maintain a simmer, and continue whisking until thick, about 2 or 3 minutes more.
Pull off the heat and add chopped chocolate if using.
Pour the pudding into individual servings or into a big bowl. Cover with plastic wrap and refrigerate for at least 4 hours or ideally overnight until set.
If you think your pudding is to thick simply add heavy cream and whip until you have the consistency you desire.
I served mine with whipped cream but plain was delicious too!