How to overcome trials?
How to overcome trials?

There is a purpose behind a trial and this purpose corresponds to our internal state and our relationship with God. God has 99 names, and it should suffice us to know that He is the most merciful, the most just and the most wise. Your test is not being put upon you by a random being but by God, who is closer to us than our jugular vein.
Tests are a way to purify us. The Prophet (peace and blessings be upon him) said, “No fatigue, nor disease, nor sorrow, nor sadness, nor hurt, nor distress befalls a Muslim, even if it were the prick he receives from a thorn, but that God expiates some of his sins for that.” (Narrated by Al-Bukhari).
Our ultimate aim is to earn God’s pleasure and paradise and all of us fall short in truly worshiping God as He should be worshiped. Many of us fail to ask for forgiveness regularly or to reflect on our state and return to God. These tests, as burdensome as they are, ease our burden on the Day of Judgment, if we respond with patience.
Trials also have a way of reminding us of our purpose. If we are far from God, the test is usually to bring us close to Him. Whatever heedlessness we are engaging in, the test should make us realize that we have no one, no one at all, but Him.
If we are close to God, it is to test our resilience. Are we only close to God in times of ease, or does our trust extend to the times of hardship? When we are tested, do we leave the good deeds that we used to do? God describes such people in the following way (meaning), “And of the people he who worships Allah is on an edge. If he is touched by good, he is reassured by it; but if he is struck by trials, he turns his face [to the other direction]. He has lost [this] world and the Hereafter. That is what is the manifest loss.” (Sura Al-Hajj, ayah 11)
This may seem counter-intuitive but tests are also out of God’s love. The Prophet (peace and blessings be upon him) said, “When God loves a servant, He tests him.” (Narrated by At-Tirmidhi).
In a sacred hadith God tells Jibreel to delay the response to the dua (supplication) of a servant because God loves hearing his voice.
Sometimes the answer to a test is that need for God, those long hours spent in the night and the tears of sincerity.