In a 2 quart saucepan, mix together cornstarch and sugar. Slowly whisk in the milk. Scrape seeds from vanilla beans and add to milk mixture. If using extract, do not add to the mixture yet.
Heat the mixture over medium heat, while stirring constantly. Bring to a boil, and boil and stir for 1 minute.
In a medium bowl, beat the egg. While whisking constantly, very slowly pour in about half of the milk mixture. Slowly pour the egg and milk mixture back into the saucepan while whisking. Return to the heat, stirring constantly. Bring to a boil once more, and boil for about 1 minute. If using vanilla extract, stir it in here.
Pour the pudding into serving dishes, or one medium dish. Refrigerate at least 1 hour for pudding to set. To avoid a "pudding skin", lightly press plastic wrap onto the top of the pudding before refrigerating.