Scald the milk in a small saucepan and bring it almost to the boiling point, then set aside.
In a saucepan, combine the egg yolks, sugar and vanilla extract and vigorously whisk until the eggs stiffen enough to form small peaks. Gradually sift and whisk the flour into the egg yolks until well combined.
Add the warm milk to the flour-egg mixture, then place the saucepan over low heat and continue whisking until it becomes a smooth cream. Cook for a few minutes, gently stirring the cream until it begins to bubble and is evenly thickened. Be careful not to burn the cream.
Remove from the heat and whisk in the butter. Transfer the cream to a bowl, cover with plastic wrap and let it cool to room temperature.
The pastry cream can be used immediately after it cools, or refrigerated until needed.
The pastry cream can be used as filling between cake layers.Makes 4 Source: