Place the egg yolks in a bowl and whisk until smooth. Place the sugar, cornstarch and salt in a pot and set to medium heat. Slowly add the milk while whisking. Cook until it begins to bubble and thicken, about 5 minutes.
Pour 1/3 of the mixture into the egg yolks, whisking constantly. Pour the egg yolk mixture back into the pot and whisk until the pastry cream comes to a boil and thickens, about 2-4 minutes. Remove from the heat and add the vanilla.
Pour the pastry cream into a bowl and cover with plastic wrap, pressing it directly onto the surface. Refrigerate until chilled and firm, about 2 hours. If the cream is too thick or lumpy after refrigerating, microwave for 30 seconds – 1 minute, then place it in a blender and pulse a few times until smooth.