Buttercream is a simple mixture of butter, icing sugar plus flavouring and, perhaps, colouring. If your buttercream is separating - because we all suffer our off days in the kitchen - you'll find that remedying the uncooperative mixture is also quite simple.
Whipping, chilling, additional sugar and cream cheese
If you're certain that you sieved the sugar, the butter had the right texture and that everything - including flavourings and colour - were measured correctly, try whipping your buttercream a few minutes longer. If you're using an electric mixer, turn up the speed one or two settings. Give this method 5 to 6 minutes to work.
If the first method didn't work, the butter or flavouring was likely too warm - ovens do tend to warm the kitchen. Put that bowl of what's supposed to be buttercream into your freezer for 5 minutes, or into the fridge for 10 minutes. Let the mixture return to near room temperature and try whipping it again.
If chilling did little to smooth and firm your buttercream, you'll need to incorporate additional icing sugar. Start with 1 tablespoon and mix for for a minute or two before adding more sugar - 1 tablespoon at a time, up to 4 tablespoons. If this method worked - finally - but you now find the buttercream too sweet, add either a small amount of lemon juice or a pinch of salt.
If extra whipping, chilling or sugar didn't help - and you've not the time or ingredients to start afresh - it might be time to try a variation of your recipe: cream cheese frosting. Usually made with about twice the cream cheese to the butter, you'll need to use less of the cheese as the mixture is already butter rich. Start with just 25 to 30 grams of softened but firm cream cheese and mix for a minute or two. If the mix is blending nicely but still too soft, add more cheese.
Always check that the butter is fresh. For buttercream, butter should be soft but maintain its shape. Sieve the icing sugar to avoid clumps in the frosting.