In a medium saucepan, bring milk and vanilla extract to a boil. Once it boils, turn the heat off.
Meanwhile, in a separate bowl, whisk egg yolks with sugar until smooth, thick and pale yellow. Then stir in flour and cornstarch.
To temper the egg yolk mixture, take about ½ cup of hot milk and add it into the egg yolk mixture, while stirring vigorously. (TIP: Place a damp towel under the bowl with egg yolk mixture to prevent it from sliding all over while you pour hot milk and whisking simultanuously.)
Now, add the tempered egg mixture back into the saucepan with remaining milk. Cook it over medium heat, stirring constantly, until it comes to a boil, about 5 minutes. (Note: It's normal if the mixture looks curdled in the beginning, be patient and it'll smooth out.) To see if the mixture is boiling, stop whisking for a moment. If it's burping bubbles, cook for 1 minute and remove from heat.
Run the custard through a sieve, if desired, and transfer into a clean bowl and cover with a plastic wrap, so it touches the cream and refrigerate it for at least 2 hours. (TIP: Don’t be alarmed if your chilled pastry cream looks too thick and lumpy. Simply whisk it until smooth again.)
Optional step: whip heavy whipping cream till hard peaks form. Fold in the whipped cream into the chilled pastry cream and gently fold until well combined. This's called creme diplomat.