Bring the milk to a boil in a small saucepan, then remove from heat.
In a small bowl, whisk the egg yolks with the sugar until light and creamy. Then add the flour and, very, very, very slowly, add the hot milk while whisking.
Tip: You really need to add the hot milk slowly to avoid cooking the eggs! I suggest adding one ladleful at a time.
Return the mixture to the saucepan and bring to a boil over medium heat, whisking constantly. Let the filling boil for at least 2 minutes.
Strain the filling through a sieve to ensure there are no lumps.
Transfer to a bowl, cover with plastic wrap, and let cool in the refrigerator.