In a medium saucepan, whisk together the granulated sugar and cornstarch. Gradually whisk in about 1/2 cup of the milk until a smooth paste forms.
Whisk in the remaining milk and the egg yolks. Cook over medium heat, stirring constantly, until the mixture thickens and just begins to bubble. Do not boil.
Remove from heat and stir in the finely ground pistachios, vanilla extract, and unsalted butter until the butter is melted and the mixture is smooth.
Pour the pistachio cream into a bowl. Cover the surface directly with plastic wrap to prevent a skin from forming. Refrigerate for at least 2 hours, or until chilled and set.
Serve chilled as is, or use as a filling for cakes, tarts, or pastries.
Notes
Garnish with chopped pistachios before serving for extra texture and flavor.