In a medium heavy saucepan combine sugar and cornstarch. Stir in milk. Cook and stir over medium heat until thickened and bubbly. Cook and stir for 2 minutes more. Remove pan from heat. Gradually stir 1 cup of the milk mixture into egg yolks.
Add egg mixture to milk mixture in saucepan. Bring to a gentle boil; reduce heat. Cook and stir for 2 minutes more. Remove pan from heat. Stir in butter and vanilla. Pour pudding into a bowl. Cover surface of pudding with plastic wrap. Serve warm or cold (do not stir during chilling). Makes 4 servings.