2 cups milk or half and half
2/3 cup sugar
1/3 cup cornstarch
2 tsp vanilla extract
2 Tbsp unsalted butter
Combine the milk or half and half, and half the sugar in a nonreactive saucepan. Whisk once and place over medium heat to come to a boil.
Meanwhile, whisk the yolks, salt and the remaining sugar in a bowl. Whisk the flour into the yolks.
When the milk boils, whisk a third of the boiled milk into the egg mixture, whisking constantly. Return the milk to a boil and pour the hot egg mixture back in a stream, whisking constantly. Continue whisking until the cream thickens and comes to a boil. Remove from heat and whisk in the vanilla and butter. Cover with plastic wrap, pressing the wrap onto the surface and refrigerate until needed.