Suicide is prohibited by the Torah, but the Talmud shows great sensitivity when people end their lives in the wake of overwhelming loss. One episode recounted there (Hullin 94a) involves a man who accidentally sold his costly barrel of wine for the price of olive oil. There were some oil drippings on the cover of the barrel and he had mislabeled it as the much cheaper liquid. When he realized he was wiped out financially, he hanged himself.
The rabbis’ response was to caution the public not to drip oil on wine barrels.
Another story involves a dinner party in which the adult guests were given a special dish the children of the family were not permitted to share. Some of the guests felt bad for the little boy coming in and out of the room looking longingly at their food, so they slipped him a few pieces. The father was not privy to these transactions so when he spotted the kid with the goodies in his hand he gave him an angry whack. Somehow the blow caught him the wrong way and the boy was killed. The distressed father could not face what he had done, so he killed himself. The mother, broken by her sudden loss, jumped off the roof as well.