Whisk the sugar, flour, and salt together in a saucepan over low-medium heat. Slowly pour in the milk while whisking until no lumps remain.
Whisk continuously and cook until the mixture thickens without turning up the heat. It should reach a thick custard-like consistency. This is your roux mixture.
Once finished cooking, transfer to a heat-safe bowl, cover the surface with plastic wrap or wax paper, and place the mixture in the fridge until completely cool.
Once it's cool, add the soft butter to a large mixing bowl and whisk on medium-high speed until light and fluffy, around 2-3 minutes.
Add the roux mixture one spoonful at a time and whisk on medium-high speed for 20-30 seconds between each addition. Continue until all of the roux has been added, scraping down the sides of the bowl as necessary.
Add the vanilla (and other flavourings, if using) and continue whisking for 1-2 minutes until light and fluffy, and the roux is fully incorporated into the butter.
Use immediately to frost your cupcakes or cake or store in an air-tight container in the fridge for up to 4-5 days. When ready to use, allow it to warm back up to room temperature before using, as it would have solidified in the fridge.