Gather all your ingredients. Measure out the milk and sugar, and separate the eggs. In a mixing bowl, whisk together the eggs, 1/2 cup of sugar, and cornstarch until smooth.
In a medium saucepan, heat the remaining 1/2 cup of sugar and the milk over medium heat. Stir occasionally until the sugar is dissolved and the milk is just about to simmer.
Slowly pour about a cup of the hot milk mixture into the egg mixture while continuously whisking to temper the eggs.
Pour the tempered egg mixture back into the saucepan with the remaining milk. Cook over medium heat, whisking constantly until thickened and bubbling, about 5-7 minutes.
Remove from heat and stir in the butter and vanilla extract until fully incorporated.
Transfer the pastry cream to a clean bowl. Press plastic wrap directly onto the surface of the cream and refrigerate for at least 2 hours before using.