Take two tablespoons of white sugar and put into a bowl along with the egg yolks and cornstarch – whisk to combine
Put the remaining sugar into a saucepan with the milk and vanilla and slowly warm over medium-low heat
When it begins to get warm, drizzle a small amount of warm milk into the egg yolk mixture and whisk, then add a little more, repeat until everything is together in the bowl, then pour the whole mixture back into the saucepan. It's important to do this slowly and gradually so you don't scramble the eggs
Keep heating the mixture, whisking constantly until it begins to boil. Boil for 1-2 minutes or until it begins to thicken. Remove from the heat.
Pass the pastry cream through a fine-mesh sieve into a bowl to make sure there are no lumps. Cover with plastic wrap and let it cool to room temperature.
Make the Chocolate Custard Buttercream
Once the custard is cool, chop the chocolate into small pieces and melt the chocolate in the microwave in 30-second increments until completely melted. Set aside to cool while you prepare the butter.
Beat butter and powdered sugar together until pale and creamy.
Add in cocoa powder and beat until totally incorporated. Scrape the sides of the bowl to make sure everything is mixed evenly.
Switch to a whisk attachment and gradually add the custard 1 tablespoon at a time, whisking on medium speed as you go.
Once the custard is completely added, pour in the cooled melted chocolate and continue whisking until everything is totally combined. The frosting should be smooth, silky and chocolatey.
Notes
For extra tips for success on making the pastry cream, see my Creme Patissier recipe post for step-by-step instructions and process shots.