I wish I could remember where I found this recipe!
3 T Flour
1/2 C milk (whole milk is best, but I used 2% when it's all I have and it's fine)
1/2 C unsalted butter
1/2 C sugar (that's granulated sugar, not powdered sugar)
1 tsp vanilla extract
Whisk together the flour and the milk. Heat in a small sauce pan on medium heat. Whisk continuously until it starts to thicken. Let it cook, while stirring, until it looks like pudding (you should be able to see the bottom of the pan when you stir it). Even though it's thick, you can still push it through a mesh strainer (just whisk in the strainer to push the thick stuff through) and then let it cool completely to room temp. or chill it in the fridge. It needs to be cooled completely. If you don't let it cool completely, it will melt the butter and you'll have runny frosting.
It an electric stand mixer, beat the butter and the sugar for a minute or two until well combined and fluffy. You'll want to use the whisk attachment on a stand mixer, not the flat paddle. Then while beating, add in the thickened milk mixture and the vanilla. Beat for 7 minutes, maybe even 8.