Mix the cornstarch and sugar in a medium-sized saucepan.
This ensures the sugar doesn't clump when added to the liquid.
Gradually add milk to the dry ingredients, whisking constantly to integrate everything smoothly.
In a separate bowl, beat the egg yolks until smooth.
Slowly add a small amount of warm milk mixture to the eggs to temper them without scrambling.
Pour the tempered egg yolk mixture back into the saucepan, continuing to stir over medium heat.
Cook until the pudding thickens, typically around 5-7 minutes.
Remove the saucepan from heat.
Stir in the vanilla extract and butter until the mixture is silky smooth.