- Mix sugar and flour in a saucepan away from the heat. Whisk in eggs until incorporated.
- Heat the mixture over medium-low for about 1 minute. Gradually pour in hot milk and vanilla, adding a little at a time and whisking constantly until sauce has thickened, about 5 minutes. Remove from heat.
- Cover with plastic wrap and refrigerate until completely cold, for at least 3 hours.
- Use the pastry cream as a pie filling or in trifle, or serve with fresh fruit.
You can flavour your pastry cream, for example with almond or coconut extract, or by adding melted chocolate for a chocolate version.