When you bake a cake and it's done baking and you take the cake out of the oven you should leave the cake in the cake pan for at least 10 minutes to allow the cake to cool down before removing the cake.
If you take the cake out of the pan right after baking the cake the cake may come apart so allowing it to cool for at least 10 minutes makes sure that the cake doesn't come apart.
You should also way around 15 minutes or so to allow the cake to cool down enough before putting any icing on top of the cake.
If you add icing to a hot cake it will melt and come off the cake so by the time you allow the cake to cool down before removing it from the pan then the cake will be ready for the icing.