In Islam we have a lot of information about bad things happening.
The first thing we have to always remember is that this world is temporary and it's the next life that we are working for. To get into Paradise we first need to please Allah (translated at The One God). Through His pleasure with us, we can attain Paradise.
He created us so that we may worship Him. Not just us but the jinns too. We have been sent Prophets and Messengers to show us how to do that and information revealed in His books.
This life is one huge test. Everything we do, from the moment we wake up to when we go to sleep, can be worship. It's all based on intention. For example, when we wake up we have a prayer in Arabic which means, Praise be to Allah who gave us life after death (as the state of sleeping is the closest thing to death) and to Him is our return.
We are constantly reminded of God and that life is temporary.
If someone passed away we say a verse of the Qur'an in Arabic which means, Verily we belong to Allah and to Him is our return.
When we sleep we say, Oh Allah, in your name I die and in your name do I live.
We are taught a lot about patience. Patience patience patience. Through tough times, at all times. And we have hadiths (sayings of the Prophet Muhammad peace be upon him) which cover every aspect so we have something to comfort us. For example, if a mother loses a baby in pregnancy, we are told that on the day of judgement, when everyone will be worried about their state and whether they've done enough, when the sun will be just above our heads and the shade will be granted only to certain people, when a mother will turn away from her son, a friend will turn away from a friend, a sibling will turn away from their sibling (as everyone will be so worried about their own deeds and avoiding going to hellfire), the foetus will come and hold the mother's hand and take her all the way to Paradise.
When our eternal abode and Allah's pleasure is our aim, it really helps to know that even the worst of situations means something. We don't just think about the present and now but the hereafter. Yes the time will be hard but patience is beautiful. It's fine to cry, but wailing and becoming despondent in Allah's mercy is not encouraged.
If a mother loses a child, we have the following hadith to remember what will come out of it:
The Messenger of Allaah (peace and blessings of Allaah be upon him) said:
“When the child of a person dies, Allaah says to His angels: ‘You have taken the soul of the child of My slave?’
They say: ‘Yes.’
He says: ‘You have taken the apple of his eye?’
They say: ‘Yes.’
He says: ‘What did My slave say?’
They say: ‘He praised You and said innaa Lillaahi wa innaa ilayhi raaji’oon.’ - To Allah we belong and to Him we shall return.
And Allaah says: ‘Build for My slave a house in Paradise, and call it the house of praise.’”
Narrated by al-Tirmidhi, 1021
Also not forgetting that we will be reunited with our child in Paradise. In Paradise everyone will be the same age though, no one will have any ill feeling towards anyobe else as it will be as if we all share the same heart.
We also are reminded to look at people worse off than us. This is something I didn't do for a few years and I felt much worse. Now that I am aware of those less fortunate than me, I can put things into perspective and give myself a reality check quickly. For example, I am aware of the huge amount of people in war torn countries, innocent people who have had to flee from their homes and live under olive trees or open land. No food or water until a charity may notice them. They are having to give birth in these conditions and this choice is not their own choice but many have lost children when their house was bombed or perhaps the child's limb has had to be cut off as the hospitals are all bombed so in the UK, their limb could have been saved but where they are, in order to prevent further damage to the body, they e had to just remove an arm or leg altogether.
I also think of the countries that have heard earthquakes and tsunamis and lose everything. Or even the countries where people are born into poverty. Or the countries where they are in so much poverty that young girls are forced into prostitution with no way out. To me I feel like there is so much more to be thankful for when doing this that my own loss or pain, despite being hard no doubt, could be much much worse. Imagine being in the above situation and with the loss too. It seems as if those worse off than us have more to thank about despite their situation and this may be why the poor will be the first to enter Paradise.
Every difficult situation we think, this is a test, how am I going to get through it? Will I be patient and believe in Allah's will for me or will I fall to listen to the whispers of Satan? As that's when he pounces on a person. We remember that this world is much bigger than us. We didn't create it. In a hadith we are told that this world is a heaven for a disbeliever and hell for s believer. This makes a lot of sense. If we don't believe, we have no rules set by Allah and we can do whatever we want. Believing means we come to a reality that this world will have a lot of rubbish things happening but the comfort is that there is an everlasting hereafter where no bad things will happen, if we just believe and get through this massive test which is called life.
When bad things happen to us, it also means our sins get erased. And on the day of judgement out good and bad deeds will be weighed. All the things we do in this world are recorded by two angels, one on our right shoulder, one by our left shoulder. The good and bad deeds have a book each. If we receive the book in our right hand on the day of judgement, it means we did well and we will be joyous. All of this is recorded in the Qur'an. The ones who receive it in the left will be so full of regret. If only I could go back to the earth and redo my test!
We all know that feeling already!
One last point I will mention is we are reminded to look at the lives of the prophets. We know the Bible is not in its original form that it was revealed in, Google if you want to check but this is told by Christians themselves but we as Muslims do believe a book called the gospels was revealed to Jesus peace be upon him. The new Bible mentions prophets were guilty of incest and also God not being fair by forgiving Aaron and not his people. As Muslims we do not believe that. We are told prophets were free from sin and were examples to follow. They did not commit such acts nor was God unfair (Aaron did not worship the calf and it was a man who was called Samiri who made it but the people were all given a chance for forgiveness by God after they regretted their ways). So to look up to a prophet they need to be free from such crimes. Anyway the point is that the prophets didn't have it easy either. Joseph peace be upon him was thrown in a well by his own brothers, his flesh and blood, away from his father who loved him. He was alone, and for many years was alone even when he was moved by travellers and then the wife of the governor tried to reduce him as he is the most beautiful man created, but he refused to accept her advance and ran away from her. She accused him and he was proven to be innocent but then went to jail as he preferred jail to be around her and her advances. He spent many years in jail. I don't think that would be a life any of us would want to live either but even through all of that he was patient and he knew it was from God and that whatever hell on earth he faces, it's the next life that is Paradise. He used his time even in the jail to call people to the worship of One God whereas someone like me would probably just be miserable and pity myself unless I did look at role models and examples to follow in character and in action.
The Prophet Muhammad peace be upon him, his father passed away before he was born. His mother passed away when he was 6 years old. When he received the revelation of the Qur'an bit by bit via Angel Gabriel and was given the instruction to call people to One God, he and the small amount of followers were banished to some mountains and all food aid was cut off from them to the extent that the would eat dry leaves. Because of this his dear wife Khafijah passed away. He was then a single father of five daughters. Could life get any worse? He was offered to be a king, to have all the riches and women he wanted by the disbelievers if he simply gave up his message of calling to one God but he refused as he knew that was not what life is about. This life is so short it is not worth exchanging the life of the hereafter for this temporary life. He also lost two sons, one as a baby and one as a three year old who he loved to play with. I can't imagine what it would feel like to lose my three year old but despite all of this he continued and taught us manners, how to live this life, how to keep going all through Allah's revelations.
Moses peace be upon him was also separated from his mother and brought up by the Pharaoh who ordered women and children to be killed mercilessly. He watched all of this. Pharaoh killed his own wife. He was then banished from the land by Pharoah but eventually after difficulty comes ease and as Muslims we are promised that by Allah.
Remember, it is okay to grieve and be sad and cry. To talk and to remember. But then there gets to a point where we have to remember those worse off than us, to look at the lives of the prophets was examples of people who did not have it easy at all and then to move on from that and refocus on the real goal which is the hereafter and all that loss and difficulty that was on us in this world will be rewarded with much more in the hereafter.