Over medium heat, heat the milk in a medium saucepan for about 8-10 minutes. Stir to prevent scalding. Remove once you notice bubbling.
While milk is heating, in a medium bowl whisk sugar and egg yolks together. Add cornstarch and whisk to combine.
Once milk is heated, pour approximately half of the milk into the egg mixture, whisking constantly. This is tempering the egg mixture. Once incorporated, add the remaining milk and whisk to combine.
Add the mixture back into the saucepan and cook over medium heat for about 5-6 minutes. Whisk constantly during this cooking process to prevent burning. Remove once the mixture starts to release large bubbles and thickens - as you move the whisk through the mixture it should be firm enough to hold the lines.
Remove the pastry cream from the heat and stir in the vanilla and butter.
Pour the pastry cream into a bowl or glass container. Cover with plastic wrap, pressing the wrap directly onto the surface of the cream to prevent a film from forming. Refrigerate for at least 2 hours, until chilled.