Mix the dry ingredients: In a saucepan, combine the sugar, cornstarch, and salt.
½ cup granulated sugar, 3 tbsp cornstarch, ¾ tsp kosher salt
Mix the wet ingredients: In a separate bowl, combine the egg yolks and milk. Add the liquid to the saucepan of dry ingredients and whisk until smooth.
2 egg yolks, 2 cups whole milk
Cook the pudding: Place the saucepan over medium-high heat, whisking constantly until thickened, coating the back of a spoon, 5-7 minutes.
Add the flavorings: Remove from the heat and add the vanilla extract (or vanilla bean paste) and butter, whisking until well incorporated. Before chilling, place a piece of plastic wrap directly on the pudding to prevent a "skin" from forming. Chill completely, then serve.