Combine the egg yolks, sugar, salt, vanilla extract, and cornstarch in a large heat-proof bowl. Whisk vigorously until smooth.
Heat the milk in a saucepan on medium heat. You may need to stir or whisk occasionally to prevent any of the milk solids from sticking to the bottom of the pan. Once the milk starts to very lightly simmer, with small bubbles forming around the edges, remove it from the heat. Pour half of the milk into the egg mixture, while whisking vigorously to prevent the eggs from clumping together. It helps to put a towel underneath the bowl to help prevent it from sliding around.
Then, pour the egg and milk mixture into the saucepan with the rest of the milk and whisk (it's easiest to do this off the heat!).
Place the saucepan back on medium heat and continue to whisk. Once the mixture is heated through, it should start to thicken (note: for the starches to thicken, it needs to get up to near boiling point. Our stove runs quite hot so we keep it at medium heat or lower; if you need to turn it up, you can do so). Whisk for about 30 seconds after bubbles start to break the surface to ensure the starch has fully thickened the mixture. Remove from heat and add the butter, whisking until it melts into the mixture.
Transfer to a bowl and cover with plastic wrap, making sure that the plastic wrap touches the surface of the cream to avoid a skin forming. Refrigerate for 1-2 hours or until cooled. Then you can use the pastry cream to fill pastries, use in cakes, or for whatever you like!