Whisk egg yolks in a small bowl till smooth.
Combine sugar, cornflour, and salt in a saucepan over medium heat.
Add milk to the saucepan in a slow and steady stream, whisking constantly. Cook till mixture thickens and begins to bubble, about 5 minutes.
Temper egg yolks by slowly pouring milk mixture into egg yolks.
Pour tempered egg yolk mixture back into the saucepan. Cook over medium heat until it comes to a full boil and is thick enough to coat the back of a spoon.
Remove custard from heat. Stir in vanilla.
Strain custard through a fine sieve into a clean bowl. Cover with plastic wrap pressed directly onto the custard’s surface to prevent a skin from forming. Refrigerate until chilled and firm, at least two hours or overnight. Store in the fridge for up to 3 days.