There are many different versions of creme patissiere. This is the one I learnt at Ecole Banette. Do use whole milk rather than any other type. Once it is cooked, cool quickly and store until needed.
Half fill a large bowl that your mixing bowl will fit into with cold water.
Melt the butter in the milk in a saucepan
Mix the cornflour and the sugar together in a bowl.. Add the eggs and beat well
Pour a little of the warmed milk and butter into the eggs, cornflour and sugar. Mix well
Pour all the mixture back into the saucepan and cook until thick (about 3 minutes)
Pour the mixture back into the bowl and carefully place into the larger bowl of cold water to cool. Place a plate on top of the bowl to stop a skin forming
The mixture can be kept for 2 days in the refrigerator. It does not freeze well.