In a large saucepan, mix sugar, corn starch, cocoa powder, and salt. Pour in milk. Whisk until combined. Add egg yolks if desired and whisk until mixed.
Place saucepan over medium heat, stirring constantly. Bring to a boil, then boil for 1 minute, until mixture begins to thicken. Remove from heat.
Add butter, vanilla, and optional chocolate chips. Stir until dissolved. Stir while warm, or chill and serve. Top with whipped topping if desired. Enjoy!