In a bowl, whisk together egg yolks and set aside.
In a pot, pour in the milk. In a separate bowl, mix cocoa powder, cornstarch, sugar, and salt. Add this mixture to the milk and heat over medium-high heat until it boils, stirring continuously for 3-5 minutes until it thickens.
Take ¼ cup of the mixture and add it to the egg yolks, whisking to temper them. Combine the egg yolk mixture with the pudding and cook for an extra 1-2 minutes until it reaches the desired consistency.
Remove from heat, stir in vanilla, and strain the pudding into a bowl. Cover with plastic wrap pressed directly onto the pudding to avoid forming a skin. Refrigerate for at least 2 hours before assembly.