Complex sentence: Casper thinks that he made a mistake leaving home, but when he hears a train whistle he decides to kill himself by having the train run over him, apparently forgetting that he is already dead.
Split into simpler sentences: Casper thinks that he made a mistake leaving home. When he hears a train whistle he decides to kill himself by having the train run over him, apparently forgetting that he is already dead.