Bring the milk to a boil in a small saucepan. Meanwhile, in a separate, medium, heavy-bottomed saucepan, whisk the yolks together with the sugar and cornstarch until thick and pale. Whisking continuously, slowly drizzle in about ¼ cup of the hot milk, which will temper your yolks. Then, still whisking, add the remaining milk in a steady stream over the tempered yolks.
Put the pan over medium heat, whisking continuously, and thoroughly, bring the mixture to a boil. Whisk and boil for 1-2 minutes, remove from heat. Allow to cool for 5 minutes. Whisk in butter and vanilla extract until completely combined and the mixture is silky smooth.
Scrape the pastry cream into a bowl. You can press a piece of plastic wrap against the surface of the custard to create an airtight seal, and pop it in the fridge until completely cooled. Alternately, if you want it cooled quicker, you can set the bowl into a larger bowl filled with ice cubes and cold water, stirring occasionally until it is thoroughly chilled, about 20 minutes.