We were brought up to believe that everything happens for a reason even though we might not know what the reason is right now. If something does not happen for us, we are told that it was not destined. As Muslims we believe that we must work for whatever we wish to achieve and then leave it to Allah. We have done all what we can, and Allah will choose the best for us. We cannot run away from what is written, but at the same time we have a power to choose and draw our own path. This may seem unfair to many of us. We may fear to question or be upset about what is destined because we think it is wrong to question what Allah has written for us.
Again as Muslims, we are NOT asked to do NOTHING and wait for what is written. We must work for this life as though we will live forever and work in the afterlife as if we will die tomorrow. That way we will secure good lives for us and others in this life and for ourselves in the hereafter.
When there is a medical mistake in hospitals in Muslim countries, you hear many people say: "Lives are in the hands of Allah. Nobody will longer than the life they are written." That is true. We believe that. But it is not anti-Islamic to question the medical mistake and how it can be avoided in the future. If a person's life comes to an end, we can do nothing about it. And nobody living in this planet can resurrect them. Let us not contribute to this person's sickness and death. If the death is from Allah, which it is, let it be. But that does not mean medical mistakes are okay, and that doctors should not be blamed.
A young woman in the hospital was accidentally given an overdose of medications. She was already ill and tired before the overdose and felt her life was coming to an end. If it is meant to be and is written, it does not mean that it is okay that she is given an overdose. If a cat was meant to die on a certain day and you ran her over with your car, it does not mean that you did not murder the cat. If it died on it's own after crossing the street, nobody would blame you, but if you run it over, it is a different story.
Everything does happen for a reason, but do not let yourselves be this reason.