In a small saucepan, whisk flour and milk together until well-combined.
½ cup all-purpose flour, 1 ½ cups milk
Heat, stirring constantly, until it thickens.
Remove from heat, and let it cool to room temperature.*
Stir in vanilla.
1 teaspoon vanilla extract
While the mixture is cooling, cream the butter, sugar, cocoa powder, and salt together until light and fluffy on medium high, about 5 minutes.
1 ½ cups salted butter, 1 ¾ cups granulated sugar, ¼ cup unsweetened cocoa powder, Pinch of salt
Add the completely cooled milk mixture.
Beat it for about 5 minutes on high until it looks like whipped cream. It may look separated at first, so keep beating it until it comes together and looks like a whipped cream.
If it looks separated after about 7 minutes of whipping, cover, and chill for about 30 minutes. Then, continue whipping for about 5 minutes, or until it looks like whipped cream.
Notes
*This is key. The mixture can't be warm or it will melt the butter. **Nutrition facts are estimates.