In a medium saucepan, whisk together sugar, cornstarch, and salt.
Gradually whisk in milk until smooth, then place over medium heat.
Cook, stirring constantly, until the mixture begins to thicken and bubble—about 5-7 minutes.
In a separate bowl, whisk the egg yolks. Slowly pour in a small amount of the hot pudding mixture while whisking to temper the yolks.
Return the tempered yolks to the saucepan and continue cooking, stirring constantly, for 2-3 more minutes until thickened.
Remove from heat and stir in butter and vanilla extract until fully incorporated.
Pour pudding into serving dishes, cover with plastic wrap (pressing directly onto the surface to prevent a skin), and refrigerate for at least 2 hours before serving.