Difficulties and hardships are among the means of divine tests. Sometimes one goes through difficulties and adversities although he has not committed any sins or wrongdoings. Happy and joyful events are also among means of trial.
God says in the Holy Quran, in verse 155 of Surah Al-Baqarah:
“We shall test you through fear, hunger, loss of life, property, and crops. (Muhammad), give glad news to the people who have patience”.