Allah has tested the people of the past in various ways and will keep on testing His creation. He has informed us about these tests in the Quran. Our beloved Prophet Muhammad also informed us that Allah will test us from time to time.
This world is an abode for tests and one should not deny or avoid these but should face them and pass them successfully. A person can be put into hardships for a number of reasons and we might not know those reasons when undergoing a certain loss but what we must do is always remember Allah, be patient, give charity and ask Him to help ease out our hard times. If we do fail to do this then we should turn to Allah and ask for forgiveness. Allah is Most Merciful and InsyaAllah He will forgive us for the wrong that we do.
On no soul doth Allah Place a burden greater than it can bear – [Quran 2:286]