Let it cool 'til it's 100% room temperature -- not even a hint of heat left. Other people have made good suggestions about hurrying this along: Put it in a cold garage, under a fan, etc. Err on the side of too much cooling time.
Letting it cool is especially important if you're using real buttercream. Think about how little heat it takes to melt butter. And heat is the kiss of death for fondant.