All the prophets, being human beings, had to undergo tests and trials which resulted in temporary stress. They constantly remembered God and received peace through His remembrance. Prophet Muhammad (pbuh) for example, himself used and advised his followers to use the following prayerss in time of distress.
"God is sufficient for us. He is an excellent guardian. We repose our trust in God".
"Surely we belong to God and to Him shall we return. O God, I beseech you for the reward of my hardship. Reward me and compensate me for it with something good".
Islamic Perspective on Stress Management, Health Concerns for Believers, Shahid Athar M.D