Place your butter and vanilla in a medium sized, heat proof bowl. Set aside. Pour your milk into a medium sized saucepan. Place over medium heat and bring up to a light simmer.
In a medium bowl, combine your egg yolks, sugar, and cornstarch. Whisk together until you get a smooth and pale mixture. The mixture will be a bit thick when you start whisking, but as the sugar dissolves, the mixture will become liquid.
Gradually pour the hot milk into the egg mixture, whisking constantly to avoid scrambling the eggs. Wipe out your saucepan if there's any residue on the bottom. Place a strainer over your saucepan, and strain your milk and egg mix back into the pan.
Return the saucepan back to medium heat. Cook the pastry cream, whisking constantly, until it starts boiling gently and thickens enough to coat the back of a spoon. Pour the pastry cream over your butter and vanilla extract. Whisk together until the butter melts and everything is incorporated.
Cover the pastry cream with plastic wrap touching the surface of the cream. Refrigerate for 4 to 6 hours, or until the pastry cream chills and firms up.