In a medium saucepan, heat the milk over medium heat until it begins to simmer. Do not let it boil.
In a separate bowl, whisk together the granulated sugar, cornstarch, and egg yolks until smooth and pale.
Slowly pour the hot milk into the egg mixture while whisking constantly to temper the eggs and prevent curdling.
Return the mixture to the saucepan and cook over medium heat, stirring constantly, until it thickens into a smooth, pudding-like custard.
Remove from heat and stir in the vanilla extract and butter until fully melted and incorporated. Transfer the custard to a bowl, cover with plastic wrap touching the surface, and let it cool completely.
Prepare the Chocolate Ganache
Heat the heavy cream in a small saucepan over medium heat until it just begins to simmer.
Remove from heat and pour the hot cream over the chopped semi-sweet chocolate in a heatproof bowl. Let it sit for 1–2 minutes, then stir gently until smooth, glossy, and fully combined. Set aside to cool slightly until thickened but still pourable.