1 1/2 cups granulated sugar
1/4 cup all-purpose flour
3 tablespoons cornstarch
1/4 teaspoon salt
1 1/2 cups milk
2 teaspoons vanilla extract
24 tablespoons (3 sticks) butter, cut into 24 pieces, softened
Combine the sugar, flour, cornstarch and salt in a medium bowl. Whisk in the milk and pour through a fine mesh strainer set over a medium sized pot. Cook the strained mixture over medium heat, whisking constantly, until it boils and becomes thick. This should take between 5 and 10 minutes and should thicken to the point that it becomes difficult to stir, like a very stiff gravy.
Transfer the mixture to a clean bowl and allow to cool to room temperature. Place the bowl in the fridge to cool it down faster if you are in a hurry, but be sure that the mixture is at room temperature (not too warm or too cool!) before adding the butter.
Beat the mixture on medium speed and add the vanilla extract. Beat in the butter one piece at a time until all 24 pieces are fully incorporated, about 3 minutes. Increase the speed of the mixer to medium high and beat the frosting for 5 minutes.
Place the frosting in the refrigerator for about 20 minutes to thicken a bit before frosting your cake.