This recipe is for vanilla pudding but you could add any flavoring you desired, just substitute it for the vanilla. For chocolate add cocoa powder along with vanilla.
2 cups milk
1/2 cup white sugar
3 Tbs cornstarch
1/4 tsp salt
1 tsp vanilla extract
1 Tbs butter
In a saucepan over medium heat, heat the milk until bubbles form at the edges.
In a bowl, combine sugar, cornstarch and salt. Pour this sugar mixture into hot milk, add a little at a time, stirring to dissolve.
Continue to cook, stirring until the mixture thickens enough to coat the back of a metal spoon.
Do not boil!
Remove from heat, stir in butter and flavoring(extract).
Pour into serving glasses and chill.