Put the egg yolks, cornstarch, and sugar in a bowl and whisk until smooth, thick, and pale. Set aside.
Pour the milk into a saucepan and heat on medium heat, stirring occasionally until it is scalding hot - this means you can see steam rising from the surface and tiny bubbles appearing on the surface.
Slowly drizzle the hot milk into the egg yolk mixture, whisking as you go. It's important to do this gradually so you don't scramble the eggs with the heat.
Once all the milk is incorporated with the egg yolks, pour the whole mixture back into the saucepan and return to the heat, whisking constantly until it starts to boil and thicken. Once you see thick bubbles bursting on the surface, boil for 1-2 minutes.
Remove from the heat and pass the pastry cream through a sieve to remove any lumps.
Add the butter, one small chunk at a time, making sure it is completely melted and incorporated before adding the next chunk.
Add the vanilla, pistachio paste, and salt, and mix it in well.
Cover the pistachio pastry cream with plastic wrap, making sure it touches the surface of the pastry cream. Let cool and then chill for at least two hours before using.
Notes
You can either buy pistachio paste, but it's super easy to make it yourself with my pistachio paste recipe.