Ira Gaines pulls a Suicide by Cop on Jack so he won't have to face the Drazens and be killed anyway, possibly in a worse way.
A variation is featured in Day 5: Jack has Christopher Henderson cornered and tells him it's over only for him to smugly inform Jack that he has men in a helicopter following Secretary James Heller's car and that if he's not released, they will kill him. Jack calls Heller to check if this is a bluff but it isn't: Heller can see the chopper. Jack apparently has no choice but to let Henderson go... until Heller informs him that he will not be used to hurt the country, tells Jack to tell his daughter he loves her and drives his car off a cliff, allowing Jack to go to town on Henderson. Luckily, Heller survives.
One season before this, Heller and Audrey are being held hostage by terrorists who are planning on staging a mock trial and executing Heller by the end of it. Realizing that they'll be dead by the end of it and with rescue looking slim, the two breaks open a gas main and attempt to asphyxiate themselves before this can occur. This fails and the terrorists are able to successfully resuscitate them moments later, but Jack is able to save them in the next hour.
Jack attempts this in the Day 7 finale. He's been captured by the Big Bad's group, he's been infected with a lethal biotoxin that will kill him in a number of hours, the terrorists want to copy the biotoxin in his bloodstream to mass produce it to threaten countless other lives, and his escape attempt from their compound has just become a bust. With no other options, he isolates himself in a room, makes use of a ruptured fuel line and attempts to use a flare to set himself ablaze. He's stopped by Tony seconds before he can ignite it, although the FBI managed to save him in the following minutes.
Played for laughs on 30 Rock, when the writers are continuously killing their own video game characters rather than let others kill them... dragging the game out forever.
In The Adventures of Superman episode "Double Trouble", the German doctor says that "they'll never take me alive". Superman tells him that "if you don't drop that gun, you're going to eat those words."
Subverted on Agent Carter; when Chief Dooley tries to get information out of a convicted Nazi officer, he offers him a "cyanide pill" to save the guy the hanging he was sentenced with at the Nuremberg trials. After he gets the information, Dooley leaves and on the way out, offers one of his breath mints to the guard walking with him.
In the first season finale of Andromeda when the Magog, an alien race who eat other sentients alive or implant their eggs in their stomachs, are closing in on Harper and Tyr, Harper requests to be shot before they get him. But at the last minute, he changes his mind and decides to chance taking them on in hand-to-hand, more in line with Tyr's Nietzschean philosophy.
President Clark in Babylon 5 puts a PPG to his head at the end of the Earth Alliance Civil War. But not before he programs the planetary defense grid to open fire on Earth, in the hopes of taking everyone with him.
The Season Two Finale has also one of those. Pinned down by Centurions and realizing the Cylons want the Colonials alive, Starbuck asks Anders to kill her rather than being sent to a Farm. It never comes to that though.
Subverted by Sharon who listens to the Starbuck/Anders Suicide Pact with a helpless look on her face; as a Cylon, killing herself would just mean she's brought back on a Cylon resurrection ship.
In El Chavo del ocho, the protagonist says this exact phrase in an episode where he's playing duel with his friend Kiko. In the Brazilian Portuguese dub: "Prefiro morrer do que perder a vida!"note "I'd rather die than lose my life!"
A serial killer suffocated himself soon after he was arrested. He even worked in a suicide note into the drawing he was working on.
Another episode of the franchise had a murderer on the eve of his execution order a peanut butter and jelly sandwich for his last meal, having deliberately failed to tell the authorities he was deathly allergic to nuts.
The Defenders (2017): John Raymond, a missing architect that Jessica Jones has been hired to track down, has forced his way into Jessica's apartment and is holding Malcolm at gunpoint. Moments after Jessica arrives, Elektra breaks into the apartment and grabs Raymond, preparing to kill him. Raymond promptly turns his gun on himself so that Elektra won't get the satisfaction of killing him, and then Elektra flees, despite Jessica's efforts to catch up with her.
Referenced, but not actually done in Dexter: Lilah murders Doakes with an explosion to cover-up Dexter's crimes, and the cops assume this was his intention: "A badass like Doakes... he'd rather burn than get burned." She probably wasn't actually invoking this and was most likely just killing him.
And subverted in Season 1. The Ice Truck Killer is found dead in an apparent suicide, and the police comment that he must have considered it his final victory because now he can never be caught. In fact, the suicide is a fake; he was killed by Dexter.
The same thing happens in Season 3 with the Skinner. Dexter kills him with a Neck Snap just as the cops are arriving. He throws the body under the front cop car, and the cops immediately assume he chose the Suicide by Cop option.
As of episode 3, this has happened twice in season 7. The first was faked to make it look that way, and the second is when a serial killer spending life in prison "confesses" to where he buried another body, but it turned out he just wanted a few days of sun and ice cream before he jumped in front of a truck.
"Tooth and Claw": Queen Victoria expresses this sentiment regarding the alien werewolf pursuing her. It's quite justified as the wolf wants to possess her, not kill her. And after the Doctor has caught the wolf in a beam that can destroy it, the wolf's host asks the Doctor to increase the strength so it's fully vaporized.
"The Satan Pit" features a variant that can probably be considered assisted suicide, when a character requests that the air be sucked from the chamber he is in before the enemy gets him.
In "Deep Breath", when it looks like the droids are about to slaughter the Doctor's friends, Strax turns his gun on himself, clearly intending to go out on his own terms. Fortunately, Vastra stops him, and a few moments later the Doctor defeats the Half-Face Man, deactivating the other droids.
In "Time Heist", the theory behind the Shredders is to die quickly rather than having one's mind devoured by the Teller, before they're revealed to be teleporters.
Flashpoint has a few perpetrators do this. A slight subversion in that Canada, where the show is set, has no death penalty, so it's more a case of "Better to die than be captured."
"Planets Aligned": Pedophile Gerald Duglin shoots himself rather than face losing the "perfect" life he's built for himself with his victim
The perpetrator in "Sins of the Father" injects himself with a morphine overdose when the police come to take him. It's stated that said perpetrator's father, on whom the perpetrator based his crimes, killed himself in the same manner under similar circumstances.
An actual death example comes up in "Last Dance", though it's ultimately averted. A young couple has found out the wife is dying of an incurable and aggressive brain disease. They decide to spend one last romantic evening together, at the end of which he will help her administer a lethal morphine overdose (unbeknownst to the wife, the husband intends to kill himself as well). Unfortunately for their plan, they committed a few crimes along the way, which got the police on their case, and SRU ultimately intervenes to prevent the couple's suicides.
In a particularly dark episode of Foyle's War, DCI Foyle reminds the episode's Big Bad of everything he's lost, including a son, fortune, and power. Foyle walks out of the house, and when a gunshot is heard and he doesn't pause, the viewer realizes that that was his intention.
Game of Thrones: In "Blackwater", Cersei procures a vial of nightshade from Maester Pycelle for herself and Tommen if the Red Keep should be breached. She also adds a touch of Taking You with Me by having Ser Ilyn Payne present to kill Sansa and the other highborn women holed up in the castle as well. At the climax of the battle, she opts to sit on the Iron Throne with Tommen and is just about to give them both poison when her father bursts in. She believes that Stannis's men would gang-rape her multiple times before killing her, and torture Tommen to death as a false pretender to the throne.
Eden in Heroes chose to shoot herself in the head rather than let Sylar take her brain (and her mind-control powers).
In the sixth season of Homicide: Life on the Street, when Detective Kellerman's dirty shooting of drug lord Luther Mahoney is exposed, and he is given the option of resigning in disgrace but going free or staying on the force but potentially going to jail (and taking some of his friends with him), he asks his ex-partner Lewis for one last favor: to give him his service weapon and leave the room for a few minutes. Lewis refuses.
The elderly patient of the House episode "Informed Consent" doesn't want to die the tortuous way described by House. He asks the doctors to help kill him painlessly, or at least discharge him so he can die on his own terms. Chase and House seem willing to honor his request (although House, as usual, needs to solve the puzzle), but in a surprising move, it's Cameron who assists him after giving a terminal diagnosis.
JAG: After Mustafa Atef, the in-universe Al-Qaeda number 3, is sentenced to death by the military tribunal in "Tribunal", he commits suicide in his cell without uttering a sound.
Lois & Clark has Lex Luthor jump from a building rather than face jail. It seems to be a point with him because later he tries to electrocute himself but Superman stops him. This might be the only time where a villain is effectively killed by being captured.
Masada, naturally, features the defenders of the titular citadel choosing to kill themselves en masse rather than let the Romans get them. However, unlike in real life, there are no survivors among the besieged Jews.
In the Monty Python's Flying Circus "YPRES 1914" skit, five World War I soldiers are trapped behind enemy lines, but there are only enough rations for 4 people to survive the trip back. One of them must take...The Other Way Out (rather than, say, surrendering to the Germans).
Inverted a bit when Gibbs' mentor Mike Franks apparently thought it was better to be killed (in a suicidal fight with a deranged Super Soldier-turned-Serial Killer) than die of lung cancer.
Director Jenny Shepard previously made the same choice and went out fighting rather than expire more slowly of her unspecified terminal illness.
Played straight in NCIS: Los Angeles, when an old colleague of Sam's swallows a coded list of Soviet sleeper agents and hangs himself. This was all part of a Thanatos Gambit to prevent arms dealer Sidorov from capturing him and torturing him for the names (many of whom had viable nuclear bombs).
In Night and Day, this is possibly the motivation for Steph McKenzie setting fire to the Halfway House either to avoid being killed by Danny Dexter, or by her brain tumor.
"A Question of Fear", an episode of Night Gallery has an interesting variation of this. A man seeks revenge on another and informs the other man that he has injected a serum into him that will turn him into a slug-like creature. The victim shoots himself, rather die like a man than live like a spineless slug. The joke's on him; there was no serum, the whole thing was a scam to get the man to kill himself.
In The Outer Limits (1995) episode "The Human Factor", a robot rigs a reactor to blow in order to Kill All Humans. The protagonist is trapped in a room with the robot. He begs the robot to snap his neck. When it asks him why he answers that he would rather die that way than getting blown up. It refuses.
The Shadow Line has Commander Penney, who kills himself rather than wait for Gatehouse to find and kill him.
Sharpe: The title character discovers that another character is a (coerced) spy and on his request, allows him to die in a glorious suicide charge rather than being executed for treachery.
Shane, in the series finale of The Shield, turns his gun on himself when the cops break down his door. Before that, though, he already poisoned his wife and son with fatal doses of painkillers; the former because she would have ended up in prison for life as well, the latter to "spare" him from going into the foster care system.
The 'die rather than let the heroes find any information' variant occurs in the Star Trek: The Original Series season 3 episode 'Elaan of Troyius'. A saboteur phasers himself to death rather than let Kirk and company find out exactly what he's done to the ship. He sabotaged the warp drive so it would blow up as soon as it was engaged.
And in the TOS episode "The Doomsday Machine" in which Commodore Decker pilots a shuttlecraft into The Machine as atonement for the loss of his crew — which gives Kirk and Spock the hint they need to destroy it.
In the Star Trek: The Next Generation "I, Borg," the Borg seem genuinely surprised that Geordi and other humans would rather die than be assimilated. (Makes you wonder why they thought humans were fighting to the death to oppose them.
Subverted in the pilot episode for Terminator: The Sarah Connor Chronicles; Sarah is jumped by the Terminator Cromartie, who is attempting to use her to get to John. She tries to commit suicide rather than be used as a tool to assassinate her son, but Cromartie grabs her gun at the last second and knocks her out.
In Wiseguy, when Sonny Steelgrave realizes that Vinny has incontrovertible evidence that'll get him executed by lethal injection, he grabs a high-voltage power cable to electrocute himself rather than face the indignity of execution.