Allah (swt) is the Lord and Master of the Universe. And Allah loves the doers of good, not those who plot evil and commit injustice. Allah (swt) brings about the days of fortune and misfortune in this world among the believers, with the sole purpose of testing and proving their mettle- to know whether they turn to their Lord with faith; hold patience in adversity, and show sincerity in God’s cause. Hence, the evil-doers will never attain a happy state in permanence, even if fleeting gains might confuse them in the present world for a period. Indeed, the future belongs to the Elects of God and the righteous believers- the true servants of God who believe in the Grace and Help of God and put their full trust in their Lord as the disposer of all affairs.
The Qur’an teaches us a lesson of spiritual life and a sublime Duah from the struggles of the Prophets and devote companions in God's Way:
“And how many a Prophet has had to fight (in God’s cause), followed by many God-devoted men: and they did not become faint of heart for all that they had to suffer in God’s cause, and neither did they weaken, nor did they abase themselves [before the enemy], since God loves those who are patient in adversity; and all that they said was this: ‘Our Lord, forgive us our sins and our excesses. Make our feet firm, and give us help against the disbelievers,’ and so God gave them both the rewards of this world and the excellent rewards of the Hereafter: God loves those who do good.” (3:147)