In a small bowl, combine the sugar, flour, cocoa powder and milk. Whisk well to combine.
Pour the mixture into a small pot and bring it to a boil over medium heat, about 5-6 minutes, whisking every minute. When the mixture is boiling, let it boil for 3 minutes whisking constantly, until it is very very thick and pudding-like.
Remove from heat and transfer the pudding into a small bowl. Place a piece of plastic wrap over the top of the pudding so it touches the surface, then place it in the fridge to cool for at least 30 minutes while the brownies are made.
When the pudding is completely cooled, place the room temperature butter into a stand mixing bowl and whip with the paddle attachment for 2 minutes on medium low until smooth.
Add the pudding into the butter 1 tablespoon at a time, whipping well after each addition until completely combined. When all the pudding has been added, whip on medium high speed for 2 minutes, until the buttercream is pale, light, and fluffy.