Combine sugar, cornstarch, and salt in a medium saucepan and whisk until incorporated. While constantly whisking, slowly drizzle in 1/4 cup of the milk until smooth. Whisk in egg yolks and remaining milk.
Place the saucepan over medium heat and cook, whisking often, until the pudding begins to thicken and just starts to bubble, about 6 minutes. Reduce heat to low and switch to a rubber spatula. Stir constantly, scraping the bottom and sides of the pan, until the pudding doesn’t run in on itself when you pull your finger across the back of the spatula but it’s still pourable, about 5 minutes.
Remove from heat and stir in butter and vanilla extract until the butter is melted and completely incorporated. Immediately transfer to 4 (4-ounce) ramekins or resealable containers. Lightly press a piece of plastic wrap on top of the pudding to prevent a skin from forming. Chill in the refrigerator until set, about 2 hours.