In a saucepan, combine sugar, cornstarch, and salt. Gradually whisk in milk until smooth.
Cook over medium heat, stirring constantly, until the mixture thickens and boils. Boil for 1 minute, then remove from heat.
Stir in butter and vanilla extract until well combined.
Pour into a bowl and cover with plastic wrap, pressing it directly onto the surface to prevent a skin from forming. Chill in the refrigerator for at least 2 hours before serving.