The double effect principle on assisted suicide, dating back to the Bolian Middle Ages, stated that "an action that had the principal effect of relieving suffering may be ethically justified even though the same action had the secondary effect of possibly causing death."
The principle played a key role in the history of the Q Continuum when in 2372, the Federation Starfleet Captain Kathryn Janeway decided to grant the Q philosopher Quinn asylum on her ship, USS Voyager based on a train of thought partially based on the principle. Quinn wanted to flee the continuum because they did not allow him to commit suicide, and had made it understood that he intended to commit suicide if he would be granted asylum, a promise he made good on shortly after receiving asylum. The death then caused the Q Civil War. (VOY: "Death Wish", "The Q and the Grey")