Heat milk in a pot. In a bowl, combine sugar, cornstarch, and salt. Whisk in egg yolks.
Add warm milk gradually, whisking to avoid clumps.
Return to heat, whisk vigorously until thickened, and bubble briefly.
Remove from heat, add vanilla, strain if desired, cover, and refrigerate for 2-4 hours.