From troop + -er, from French troupe. The sense of “one who endures adversity” comes from trouper (“member of an acting troupe”) but through assimilation with the sense of “soldier” has come to be usually spelled “trooper”.
Practice speaking and memorizing "trooper" and many other words and sentences in English.