ASLAMUALEKUM
Every event that happens to the Muslim has a sort or another of goodness in it. Allah states that even events that seem to be unfavorable may have a lot of good in them:
[It may well be that you dislike something in which Allah has placed a lot of good.] (An-Nisaa' 4:19)
[It may be that you hate something when it is good for you and it may be that you love something when it is bad for you. Allah knows and you do not know. ] (Al-Baqarah 2:216)
Mistakes, defects, or seemingly unfortunate events essentially include blessings, and each one of them is the trial of destiny. Allah gives important lessons and reminders to humans in the destiny He creates individually for each person.
Consequently, no matter what one encounters in this life, the ordeals will all eventually end. A person who recalls a hardship will be amazed that it is nothing more than a reminiscence in the mind. This is also how people recall the scenes from a film. Accordingly, one day will come and the most painful experience will become only a memory, more like the image of a scene from a movie. Only one thing will remain — the attitude a person assumed during the time of hardship and whether Allah is pleased with him or her.
People will not be called to account for their experiences, but rather for their attitudes, thoughts, and sincerity they displayed at the time of these experiences. Therefore, endeavoring to see the goodness and the divine purpose Allah creates in the situations encountered and taking a positive attitude will bring bliss to believers both in this world and in the hereafter. No sorrow or fear awaits these believers who are aware of this secret. Similarly, no one, no event can create fear, harm, or distress in this world or in the hereafter. Allah reveals this secret in the Qur'an: [Those who follow My guidance will feel no fear and will know no sorrow.] (Al-Baqarah 2:38)
[Yes, the closer servants of Allah will feel no fear nor shall they grieve: those who believe and have done their duty, there is good news for them in the life of the world and in the Hereafter. There is no changing the words of Allah. That is the great victory.] (Yunus 10:62-64)