In a medium saucepan, whisk together the sugar, flour, and salt.
Gradually whisk in the milk until smooth.
Place the saucepan over medium heat and cook, stirring constantly, until the mixture begins to thicken and bubble.
In a small bowl, whisk the egg yolks. Gradually whisk in about 1/2 cup of the hot milk mixture to temper the eggs.
Pour the egg mixture back into the saucepan, whisking constantly.
Continue to cook over medium heat, stirring constantly, until the pudding is thick and smooth, about 2-3 minutes.
Remove from heat and stir in the vanilla extract and butter until the butter is melted and fully incorporated.