Mix sugar with cornstarch and salt in a medium-sized microwaveable bowl; whisk in milk until smooth. Set aside.
Heat in the microwave for 4 minutes or until thickened, while stirring every 45 seconds.
Beat egg yolks in a heatproof bowl; to prevent curdling, gradually whisk in some of the hot milk mixture. Whisk warm egg yolk mixture back into the rest of the milk mixture.
Cook for another 2 minutes, stirring continuously, until very thick.
Stir in vanilla. Set bowl aside to cool. Stir often, for 20 minutes or until custard is completely cool.