Add cocoa to large bowl and whisk to remove lumps (or sift). Add butter and beat until combined.
Add sugar, vanilla, milk, and espresso powder, if using. Beat on low speed until combined; beat on high speed about 2 minutes until fluffy and smooth.
If consistency of frosting is too thin, gradually add more sugar. If the frosting is too thick, add milk a teaspoon at a time until frosting is desired consistency.
Makes enough to frost and fill a 2-layer cake, or to frost 24 cupcakes. Make a half batch for 9 x 13-inch cake unless you like a lot of frosting!
Video
Notes
Makes about 2 1/2 cups of frosting, enough for a layer cake.
Frosting can be made ahead and stored one week in the fridge or three months in the freezer. Put it into an airtight container.
To use, thaw overnight in the refrigerator if it's frozen. If frosting has deflated a bit, use your mixer to whip it again briefly.