Every incident happen to you has its reasons in addition to the physical cause and effects.

Please read If there is God then why so much Injustice around, Real Cause Of Afflictions, A universe of possibilities, Why righteous get more afflictions, Which religion’s followers will go in paradise, One single secret of success, This Universe is not perfect before or in conjunction with this article.
Material cause and effect

Reason of afflictions and misery
So other than diseases physical accidents material causes and effects something other than that also happening simultaneously. Your Lord is so just that although in this universe all system is running by natural laws, physics and cause and effect, even than so much justice that these problems, accidents, diseases not befall without any reason. For those who are righteous it is a way to clean them from small sins, or to increase their goods and virtues, by trial and steadfastness, and to put more patience in them. For others they are signs and warnings to refrain them from sin which they are going to do or to make them repent for the sins they have already committed. But some people are exempted from these rules and the best way to check who are those is to see those wrong doers who are top criminals in the towns doing all bad in this world but not getting anything in return, any mishap, any disease, affliction and trouble and are flourishing day by day. I feel sad for those as they are not getting any thing in this world so must be among those creation your Lord has created for Hell.

Keep in mind that because of all this, I explained above do not start judging people by seeing their circumstances and misery that they must have done some sin something wrong. There is a very subtle difference between Punishment/Azab and trial. Only God knows that who is suffering from His Wrath and whom He is testing, and despite sometimes in a similar situation, one could be a loved servant of God.
No affliction befalls you except what your hands have earned

ووصولًا إلى نقطتي، على الرغم من أن ربكم قد جعل هذا العالم بمثابة اختبار، وهذا الكون ليس مثاليًا، حتى أن هناك العديد من المشاكل، الصراعات والأمراض التي تصيبكم، فإنّ ذلك يخدم العديد من الأغراض الأخرى، وليس فقط من أجل قانون “السبب والتاثير”، ولكنّه أيضًا من عدالة ربكم لكي يُحذركم، لكي يُخيفكم أو لكي يُعذبكم.
حتى بعيدًا عن الأمراض، والحوادث الجسديّة وقانون “الأسباب والتأثير”، فإنّ شيئًا أخر يحدث أيضًا في &