Combine sugar and flour and gradually add milk stirring constantly in a saucepan.
Take saucepan to medium heat and cook, stirring, until mixture boils for 3 minutes. Remove from heat.
In a medium size bowl, whisk egg yolks until light colored.
Add yolks, whisking constantly, to hot milk.
Return to heat and continue beating until sauce slightly thickens.
Remove from heat and add vanilla. Transfer to a bowl.
Lightly pat surface with butter to prevent skin forming.