Mix sugar, cocoa, and cornstarch together in a medium sized pot.Add milk and cook on medium heat. Stirring constantly.(this step is very important)
When mixture starts to boil and becomes thick remove from stove. Stir in butter and vanilla. Pour into baked pie shell. Let cool in refridgerator for an hour.
Add whipped cream on top.