Well it may be because of our sin or it may be a test. Usually people fall short and fail to fulfil their duties, so whatever befalls them is because of their sins and shortcomings in obeying the commands of Allaah.
If one of the righteous slaves of Allaah is tested with sickness and the like, this is similar to the testing of the Prophets and Messengers which raises them in status and increases their reward, so that they may be examples to others of patience and seeking reward.
So it may be a test in order to raise a person in status and increase his reward, as Allaah does with the Prophets and some of the elite, or it may be an expiation for sins, as Allaah says (interpretation of the meaning):
“whosoever works evil, will have the recompense thereof” [al-Nisa’ 4:123]
That may also be a punishment that has been hastened because of sins and a failure to hasten to repent, as stated in the hadeeth in which the Prophet (peace and blessings of Allaah be upon him) said: “When Allaah wills good for a person, He hastens his punishment in this world, and when He wills bad for a person, He withholds the (punishment) for his sins from him until he comes to Him with that sin on the Day of Resurrection.” Narrated and classed as hasan by al-Tirmidhi.
We all know that Allaah tests the believing men and woman because He loves them and wants what is good for them? In al-Saheeh it is narrated that our Prophet (peace and blessings of Allaah be upon him) said:
“When Allaah wills good for a person, He tests him.” Narrated by al-Bukhaari (5321).
What great grace it is that Allaah cleanses His slave whom He loves of sin straight away, with trials and calamities, so that he will meet Him on the (Day of Resurrection) with no sin on him, and his joy on that Day will be great, and he will realize then that the calamities that befell him were among the greatest blessings that Allaah bestowed on him.
The Prophet (peace and blessings of Allaah be upon him) said: “On the Day of Resurrection, when people who had suffered affliction are given their reward, those who were healthy will wish their skins had been cut to pieces with scissors when they were in the world.” Narrated by al-Tirmidhi, 2402.
So look again at the life that you are living, and at the calamities that you are suffering, and think positively of your Lord, for He is the wisest of the wise, may He be glorified.
Try as much as you can to look at the positive side of every problem that you are suffering, whether it is psychological or material.
And Allah knows best.