Mix together sugar and cornstarch in a large saucepan. Add egg yolks and whisk to combine; then gradually whisk in milk.
Cook over medium-low heat, stirring constantly, until custard thickens to the consistency of thick cream, about 25 minutes.
If the custard has lumps, strain through a fine mesh strainer.
Transfer to a large bowl, and add vanilla.
Cover surface of custard with plastic wrap to prevent a skim from forming.
Refrigerate until completely chilled, about 2 hours.