Ingredients

1/2 cup sugar 

1/4 cup cornstarch 

Pinch of kosher salt 

4 large egg yolks 

1/2 vanilla bean, split and seeds scraped, or 1 teaspoon pure vanilla extract 

2 cups whole milk 

2 tablespoons unsalted butter 

Preparation

Whisk together sugar, cornstarch, and salt in a medium saucepan. Whisk together egg yolks and vanilla seeds (if using) in a glass measuring cup; whisk in milk. Add to saucepan along with butter and bring to a boil over medium heat. Let boil 1 minute, still whisking; then remove from heat and stir in vanilla extract (if using).

Strain pastry cream through a fine-mesh sieve into a bowl. Cover with plastic wrap, pressing it directly onto surface of cream to prevent skin from forming. Refrigerate until chilled, at least 2 hours and up to 2 days. Just before using, whisk until smooth.