Using a handheld or stand mixer with a paddle or whisk attachment, beat the butter on medium speed for about 2 minutes until creamy. Add the confectioners' sugar, cocoa powder, heavy cream, salt, and vanilla extract. Beat on low speed for 30 seconds, then increase to high speed and beat for 1 minute. If the frosting is too thin, add 2-3 tablespoons more confectioners' sugar or cocoa powder. If it's too thick, add another tablespoon of cream.
1 cup unsalted butter, 3 ½ cups powdered sugar, ½ cup cacao powder, 3 tablespoons heavy cream, 1 tablespoon vanilla extract, pinch of salt