In a large saucepan, combine milk and half of the sugar. Heat over medium heat until just below boiling, then reduce to low.
In a separate bowl, whisk together the remaining sugar and cornstarch. Add the egg yolks and whisk until smooth.
Do not mix the sugar, yolks, and cornstarch too far in advance—prepare this step only when the milk is hot and ready.
Slowly pour 1 cup of the warm milk into the yolk mixture, whisking constantly to temper the eggs.
Pour the tempered mixture back into the saucepan with the rest of the milk.
Cook over medium heat, stirring constantly with a whisk or wooden spoon, until the custard thickens, about 3–5 minutes. The mixture should coat the back of a spoon and reach about 185°F (85°C).
Remove from the heat and stir in the butter until melted and smooth. Add the vanilla extract and mix well.
Strain the custard through a fine mesh sieve to remove any lumps.
Transfer to a clean bowl and cover with plastic wrap directly on the surface to prevent a skin from forming.
Cool to room temperature, then refrigerate until ready to use. Serve chilled or at room temperature.