Complex sentence: He enters the cave with the magic words, but in his greed and excitement over the treasure, he forgets the words to get out again.
Split into simpler sentences: He enters the cave with the magic words. But in his greed and excitement over the treasure, he forgets the words to get out again.