In a medium heat-proof bowl, whisk the egg yolks until smooth (you'll be using them soon).
In a medium saucepan, whisk together the sugar, cornstarch and salt. Whisk in the milk.
Place the saucepan over medium heat and cook, whisking constantly, until the milk starts to simmer (the foam will mostly subside and you’ll start to see the milk plop and bubble), about 7-8 minutes—don’t be tempted to walk away during this time (whisking constantly will prevent the bottom from browning and will create a smooth texture). Remove the pan from the heat.
Slowly pour about ½ cup of the hot milk mixture into the bowl with the egg yolks while whisking (this is called tempering the eggs and will prevent them from curdling in the hot liquid). Pour the egg mixture back into the saucepan in a slow, steady stream while whisking.
Put the saucepan over medium-low heat and cook, whisking, until the pudding starts to bubble and thicken, about 1-2 minutes. Remove the pan from the heat and stir in the butter pieces and vanilla.
Pour the pudding into a storage container or bowl (if some of the egg has curdled, or if the bottom has browned, pour the pudding through a mesh strainer). Cover the pudding with plastic wrap, placing it directly on the surface of the pudding (this will prevent a skin from forming).
Refrigerate the pudding for at least 2 hours, or for up to 5 days (it will thicken as it cools). Stir well before serving.