Trials (tests, hardships, discomfort, loss, fear, hunger, etc.), they occur for one of three reasons:
- Due to sins: You will know this is the case if you display impatience with the trial, are restless, and complaining. The trial is because of a sin you committed.
- As an expiation for sins: A person paying for their sins through trial shows patience in the face of hardship, continued obedience to Allah without complaint, with complete ease on the body.
- To raise your rank: A person who Allah has chosen to raise to a higher level will show signs of calm, and obedience to Allah that is easy on the mind, body and soul. Trials for this person are a sign of love from Allah.
Knowing these three reasons, being conscience of them, will help you train to be calm and remain obedient in hardship, it will help you feel ease during these times, and all trials will become a way to raise your rank through Allah.
Righteousness is in good character and morality, is that in which the soul feels at ease and the heart feels tranquil. And wrongdoing is that which causes uneasiness in the chest, wavers in your soul, and which you dislike people finding out about.
Trials occur for one of three reasons:
 Due to sins: the sign of which is impatience, restlessness and complaining;
 As an expiation for sins: the sign of which is patience and obedience being easy on the body;
 To raise one’s rank: the sign of which is calm and contentment along with obedience being easy for the body and heart.
[Nahlawi, al-Durar al-Mubaha]
When Allah who is Great and Glorious loves people He afflicts them [with trials]. (Tirmidhi)
Anyone for whom Allah intends good, He makes him suffer from some affliction. (Bukhari)
When Allah intends good for His slave, He punishes him in this world, but when He intends an evil for His slave, He does not hasten to take him to task but calls him to account on the Day of Resurrection. (Tirmidhi)
“So know that victory is with patience, and relief is with distress and that with hardship comes ease.” -The Prophet Muhammad
And We will surely test you with something of fear and hunger and a loss of wealth and lives and fruits, but give good tidings to the patient (Quran: Surat Al Baqarah Verse 155 http://quran.com/2/155)