The manner of death is never pre-determined. A soul does not come here knowing in advance how its life will end.
Free will dominates our incarnation. Every decision a person makes leads them to various outcomes. It’s all cause and effect.
So for example, if a person stops showing up to work, he will probably be fired.
If a student stops turning in homework or taking exams he will likely fail his class.
If a person gets an advanced degree, she will likely get a higher paying job.
Every decision we make and everything that happens to us leads to an outcome. It may be a positive outcome or a negative outcome or something in between.
We live or die based on the choices we make plus the random things that happen to us while we are here.
For example, someone could have the best, happiest life and still get struck by lightning.
A person could be a horrible, mean person but still live a very long life.
A person who decides to take their own life has not pre-determined that they will do this. They get to a point where they decide to end their life because they want to, or because the pain they are feeling is unbearable.
You could be murdered, not by your direct choice but perhaps by the actions you take (hanging out in gang-infested neighborhoods, or borrowing money from a loan shark whom you can’t pay back, etc.)
You could get in a car and be an amazing driver, but still be hit by someone who chose to drink and drive.
The bottom line is that no death is pre-determined. Deaths are the result of your free will choices, or the free will choices of those who act upon you, or your lifestyle choices, or deciding you want to be done with this incarnation.
It’s difficult to deal with the premature ending of a life, whether by murder, accident, or suicide. But the moment we get to Earth we are at the mercy of choice and consequence. All we can do is stack the deck in our favor and enjoy every day we have here.