In the bowl of an electric mixer, fitted with the whisk attachment, beat butter (on medium speed) until completely smooth (30 seconds to a minute).
Add salt (if needed).
One cup at time, add 2 cups of powdered sugar, beating after each addition.
Add vanilla, or other flavorings and beat to combine.
Add about 1 tablespoon of cream, and continue beating.
Add the remaining 2 cups powdered sugar, one at a time.
Add an additional 1-2 tablespoons cream until desired consistency is reached. If you want to pipe the frosting on cupcakes, the frosting should be nice and thick. Continue to beat another minute or so. The frosting should now be smooth and fluffy.
Notes
If your frosting is not smooth, it is likely because the butter was not fully smooth before adding the other ingredients.If your frosting will not hold up when piped on cupcakes, your frosting has too much liquid or is too warm. Put entire bowl of frosting in the fridge for 15-20 minutes and it will stiffen up. If it is still too thin, then add 1/4 to 1/2 cup powdered sugar, beat well.