Bake your favorite chocolate cake (or cupcakes) and let it cool.
In a small saucepan, whisk flour into milk and heat, stirring constantly, until it thickens. You want it to be very thick, thicker than cake mix, more like a brownie mix is. Remove from heat and let it cool to room temperature. (If I’m in a hurry, I place the saucepan over ice in the sink for about 10 minutes or so until the mixture cools.) It must be completely cool before you use it in the next step. Stir in vanilla.
While the mixture is cooling, cream the butter and sugar together until light and fluffy. You don’t want any sugar graininess left. Then add the completely cooled milk/flour/vanilla mixture and beat the living daylights out of it (about 15 minutes). If it looks separated, you haven’t beaten it enough! Beat it until it all combines and resembles whipped cream.