In stand mixer fitted with paddle or whisk attachment, beat the butter on medium speed for 2 minutes, until creamy.
Add powdered sugar, cocoa powder, milk or cream, salt, and vanilla extract. Beat on low speed about 30 seconds until combined, and then beat on high speed for 1 minute.
Frost cupcakes or cake. If not using immediately, cover tightly and store for up to 1 week in the refrigerator or up to 3 months in the freezer.