Complex sentence: To the surprise of the others, Joy hands control of the console to Sadness, who is able to successfully extract the idea, reactivating the console and prompting Riley to return home.
Split into simpler sentences: To the surprise of the others, Joy has Sadness take charge. Sadness unplugs the idea, reactivating the console, prompting Riley to return home.