The hypocrites used to say to the believers that they had stayed with them, no harm would have touched them.
لَّوْ كَانُواْ عِندَنَا مَا مَاتُو{If they had been with us, they would not have died}: So they attribute death and life to causes, whereas death is related to the term, not to the causes, but you have to take the means and you are not allowed to throw yourself into death, in other words, you must not throw yourself in front of the train, and do not throw yourself off the roof of the building.
لِيَجْعَلَ اللّهُ ذَلِكَ حَسْرَةً فِي قُلُوبِهِمْ {so Allah makes that [misconception] a regret within their hearts}: They do not believe that death and life are in the hands of Allah (swt) and not in the hands of the causes, so believing that reasons are the causes of death, makes mourning is severe for the dead’s family. You must believe that the term is over, and have to accept the pain as possible as Allah (swt) wanted.