Put the egg yolks, corn starch, flour, and salt in a bowl and whisk to combine into a thick paste. Set aside.
Pour the milk, sugar, and vanilla into a saucepan and heat on medium heat.
When the milk mixture begins to get warm, drizzle a small amount of it into the egg yolk mixture and whisk it in. Then slowly drizzle the remaining milk into the egg yolks, 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.
Keep heating the mixture, stirring constantly until it stars to boil and thicken. Once you see thick bubbles bursting on the surface, boil for about a minute. The pastry cream should be thickened enough that you can coat the back of a spoon and draw a line in it. (See pictures above for guidance).
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 pistachio paste 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 for at least two hours before using. If making ahead of time, store in the fridge until ready to use.
Notes
I find pastry cream is often best when made a day ahead of time, as it lets all the flavors really develop. Store in the fridge until ready to use. You can either buy pistachio paste or make it yourself using my pistachio paste recipe.