This is my go-to recipe for pastry cream or custard. I use it in the Paczki, Boston Cream Pie Cupcakes and Danish. It's perfectly flavorful and smooth.
Pastry Cream
2 cups milk
¼ cup white sugar
2 egg yolks
1 whole egg
¼ cup cornstarch
⅓ cup white sugar
2 Tablespoons butter, cubed
1 teaspoon vanilla extract
In a heavy saucepan, stir together the milk and ¼ cup of sugar. Bring to a boil over medium heat.
In a medium bowl, whisk together the egg yolks and whole egg. Separately mix the remaining sugar and cornstarch; then whisk them into the eggs until smooth. When the milk comes to a boil, drizzle it into the egg bowl in a thin stream while stirring so that you do not cook the eggs. Return the mixture to the saucepan, and slowly bring back to a boil, immediately stirring so the eggs do not curdle or scorch on the bottom.
When the mixture comes to a boil and thickens, remove from the heat. The mixture will continue to thicken as you stir. Stir in the butter and vanilla, mixing until the butter is completely melted. Pour into a heat-proof container and cover with plastic wrap directly on the surface to prevent a skin from forming. Refrigerate until completely chilled before using.
Source: Adapted from AllRecipes