Jonathan Joestar dies at the end of the first part of Jo Jos Bizarre Adventure, sacrificing himself to take Dio with him. It isn't until part 3 that we find out that his death was in vain, as Dio's head took his body and used it to revive himself.

The first major arc of Death Note ends with Light tricking Rem into killing L, the second with Light's own death at the hands of Ryuk. So by both interpretations - L as the hero and Light as the villain, or vice versa - the hero dies.

Ash is killed by Shin's brother in the final chapter of Banana Fish.

Spike from Cowboy Bebop, though he may actually be a subversion. While there's a boatload of evidence that Spike is walking up the stairway to heaven, Word of God is that Spike's status is completely open to interpretation.

Byronic HeroLelouch is killed at the end of the series, dying in the arms of his sobbing sister Nunally. Magnificent Bastard that he is, Lulu planned the entire thing to atone for the horrible things he'd done trying to build a better world and to give Nunnally, Kallen, and the rest of humanity a chance for a better future.

He didn't plan it from the very start of the series, but as It Got Worse and his actions caused or helped cause countless deaths, he has a My God, What Have I Done? moment and decides that the only way he can truly up for all the tragedy he caused is with his own life.

Aya was supposed to die in the final episode of Weiss Kreuz Gluhen, but a manga sequel was greenlit and they retconned it so that he survived.

Though inconclusive, the nameless Gun God, the main character of Angel Notes, which is part of the Nasuverse, is possibly dead.

In Chrono Crusade, the titular Chrono's source of his powers is Rosette's own life, meaning every time he uses his powers it shortens her lifespan. When the series starts, she's not expected to live beyond thirty. And at the end of the manga, when the epilogue skips ahead eight years...

The anime version still uses this trope, but in a different way - due to having used up so much of her life during the final battle, Rosette's life span is shortened to the point where she only has months to live. Rosette and Chrono both go into hiding, getting their own log cabin to live the rest of their short lives together in peace before dying. Leaving the series here would have made is a Bittersweet Ending - however, it's then revealed that the villain may still be alive after all...

The Sky Crawlers. The anime film's Hero goes one-on-one with, and dies at the guns of, the Teacher who was previously known as Lynx/Cheetah, the player character of the Wii game, The Sky Crawlers: Innocent Aces.

Witchblade. In the anime, Masane performs a Heroic Sacrifice to destroy the Witchblade and every single I-Weapon that crowded around her.

Goku (who provides the above image) from Dragon Ball has sacrificed his life twice in the series; the first time being when he held his evil brother Raditz still for Piccolo to shoot him with his Special Beam Cannon, knowing fully well that he would have to die too. The second time was near the end of the Cell saga: Cell has inflated to massive size and is threatening to blow up the earth. Thinking quickly, Goku uses instant transmission to send Cell and himself to King Kai's planet and stays during the detonation so that the world will be safe. He is resurrected both times.

In Bakuman｡ no one dies in the main story but, Nanamine's Classroom of Truth and the main characters' Reversi kill off their main characters. The former is a Shoot the Shaggy Dog example, in which even he fails to escape the survival tournament for his class. The latter combines is a case of Dying as Yourself, and is seen in-universe as a fitting conclusion to the story.

The manga Claudine finishes with the main character commiting suicide.

Lester from American Beauty tells us that he's dead in the beginning of the film.

Ah Jong of John Woo's The Killer dies without fulfilling his promise to have Jenny's eyes fixed. The Big Bad is finished off by Inspector Li Ying, the other primary hero, but Li is arrested by his fellow officers afterward because he did it in cold blood right in front of them.

Three Hundred: With the sole exception of Dilios, whom Leonidas sent back home to rally Greek support by telling the tale of the 300 Spartans, everyone on the Spartan side ends up dead on the third day of the Battle of Thermopylae. Most definitely not a case of The Bad Guy Wins, since their sacrifice delayed the Persian army long enough for Athens to be safely evacuated before it was destroyed, and for the Greeks to begin their own campaign to drive the Persians out of Greece forever. The movie skips past a year of this campaign during the epilogue, but there's another graphic novel in the works that will be set in that missing year; a movie sequel based on this new novel has not been ruled out.

Literature

Harry Dresden as of the end of Changes. He then spends the next book, Ghost Story, solving his own murder. As a ghost.

The novelization of the original Mobile Suit Gundam, aside from many other differences from the plot of the anime, has Amuro Ray die several chapters before the end of the book. Despite Yoshiyuki Tomino's reputation as "Kill'Em All Tomino", he said that he only did it because he thought it would be a single complete story and that if he had planned on making sequels from the start, Amuro would have lived.

1984. Winston and Julia are caught, tortured and Mind Raped by O'Brien, a guy who was supposed to be their link to "the Brotherhood," but is actually a member of the Inner Party. They are broken so thoroughly that all love that they had for each other is dead (particularly since the two were forced to betray each other through means of Room 101, which faces them with their worst fear -- for Winston, it was rats, though since the story is in Winston's perspective, we never do find out what Julia's worst fear was), and then executed by being shot in the back of the head. Not just a Downer Ending, but a Shoot the Shaggy Dog, given the last four words: He loved Big Brother.

Outbound Flight. Lorana Jinzler died in a Heroic Sacrifice. She was the only unambiguously good character in that half of the novel. The other major characters, who might be called heroes, survived -- but Thrawn and Car'das and Doriana weren't entirely good people.

In Firewing, Shade the Bat kills himself in the Bat Underworld to give his son, Griffin, and his friend, Luna, life force to feed on and become living, breathing bats again. In the end, he still survives, but in the form of the foliage of the forest floor. When he's dead, he flies around the world and can be anything he wants to be.

David dies at the end of the third Dragons book, Firestar, by Chris D'Lacey. Initially, this looked like it would be the end of the series, making it an unusually harsh ending for a book aimed at the 8-12 bracket. The series didcreep on, and David came Back From TheHigher Plane Of Existence, with the implication being that he became one with God(ith) and saw all the knowledge in the universe through his daughter's eyes, but if unexpected, the ending of Firestar can be a real punch.

Antony and Galen in the second and third books, respectively, of Marie Brennan's Onyx Court series. Technically, all the mortal heroes of the series could count, as given the large time skip between books, the hero of the previous one is always dead by the time the next one comes around, but Antony and Galen get special mention for dying during their respective stories.

Robin Hood dies at the end of the third season, joining his wife Marian who had died at the end of the previous season. Despite attempts to set up for a forth season, the show was inevitably cancelled.

Farscape's John Crichton (one of the twinned two, anyway) died a hero's death at the end of Season 3's two-parter Infinite Possibilities. Luckily, there was a backup "copy" on Moya.

In the Doctor Who episode "Turn Left", the Tenth Doctor is killed in the parallel universe created by Donna's mind after he floods an abandoned Torchwood base with him inside it, creating all sorts of chaos and havoc.

In "Father's Day", the Ninth Doctor is consumed by Clock Roaches after Rose created a paradox saving her father. After her father fixes this error, he and everyone else on Earth returns.

In "The Impossible Astronaut" Eleven is killed to death, mourned, and cremated, only to show up a few minutes later, completely clueless as to why everyone is so upset. Their past, his future, cue plot arc.

In The Sarah Jane Adventures story Whatever Happened to Sarah Jane, the Trickster makes a deal with Sarah Jane's friend and switches places with 13-year-old Sarah Jane, making her fall to her death. She later relinquished her deal, causing time to return to normal.

Earth: Final Conflict is a rare case where the hero died at the end of the first season, but the show still continued without him.

Also Macbeth, King Lear, Othello, Julius Caesar... essentially, the title character of every Shakespearean tragedy (although how heroic they are is a matter of some debate in each case).

What's interesting about Julius Caesar is that the title character dies halfway through the play, spending the rest of it as a corpse, a ghost and some military inspiration. Whether or not this in fact makes Brutus the hero is up for debate.

The same applies to the title character of nearly every tragic opera as well.

Jean Valjean in Les Miserables. Also, pretty much everyone else in the cast... except the lovers Marius and Cosette, and the two most horrible people in the entire play - The Thenadiers - who become rich in addition to living. Pretty dramatic example of the trope.

Video Games

Kratos from God of War dies many times throughout the franchise, only to come back out of Hell every time. In the ending of the third game, he stabs himself with the Blade of Olympus to end his life for good. It is actually up to speculation whether he is truly dead or alive, since his body goes missing after the credits roll.

The Command & Conquer series actually does this a fair amount. For GDI, one of your operation commanders, Carter, eventually is seen with beginning Tiberium poisoning, but is killed by a Nod obelisk in his gunboat. Mc Neil, the GDI commander in Tiberian Sun ends up 'killing' Kane, but in the following expansion, Firestorm, he is killed right before the first mission when an ion storm downs his command ship (though if the Tiberium Wars novelization is canon, he wasn't on board when it happened). GDI also loses everyone on board the Philadelphia (space borne command center) in the opening stages of Tiberium Wars. If Nod is your faction, they lose both the first and second wars, with Kane being reportedly 'killed' each time. Slavik of Tiberian Sun dies right before C&C3 Kane's Wrath starts. And in C&C4, the player character themselves dies in the ending, no matter which side you choose to play as. Subverted with Kane in this case though, as he completes his plan for Ascension and leaves Earth through a Scrin portal.

To be specific, he was a dream created by the Fayth. The dreams of the Fayth, which include Zanarkand and the rest of its inhabitants, were kept alive by both their deep sleep and the Big Bad. When he dies, Tidus vanishes.

Harry Mason, the hero of the first Silent Hill, dies halfway through 3. He also dies in the non-canon Bad Ending of the first game. And in The Room, Henry dies in the worst ending.

It's been implied that the bad ending of Silent Hill 2 (James driving his car into the lake) actually is the canon ending.

The end of Bioshock 2 always involves Subject Delta dying, though it's his influence on Eleanor that determines how things end up and several of the endings involve her taking his essence so that he live on through her as a Spirit Advisor.

Call of Duty: Modern Warfare 2 is a doozy. Of the four heroes you control, two die, not to mention another character you control for all of five minutes. That's three out of five player characters dead by game's end, not to mention multiple NPC squadmates, but that's more Anyone Can Die.

Medal of Honor 2010: Rabbit is captured by the terrorists and mortally wounded, and his rescuers encourage him to hang on while the rescue chopper arrives, with the first person view periodically blacking out, but he ultimately expires.

Nathan Hale in the ending of Resistance 2. Though he had just succumbed to The Virus he'd been struggling with the whole time, so he technically wasn't a hero when he died.

Nariko from Heavenly Sword succumbs to the curse of the title sword and dies at the end. Though not before taking King Bohan with her in a final showdown.

Martin Septim from Oblivion dies to summon the God Akatosh in order to kill Dagon. He may not be the player, but Martin is arguably The Hero.

The silent protagonist Anon from Tron Evolution died protecting Quorra from a huge falling aircraft.

In LA Noire, Cole Phelps is killed by a rush of water during the final case in a sacrifice to save an old member of his unit. The last cutscene before the credits takes place at his funeral.

In The 3rd Birthday, depending on how you look at it, Aya Brea was revealed to be Eve all along throughout the whole game that you play as her. In the ending, Aya and Eve switched bodies, with Aya in Eve's body doing a Heroic Sacrifice to be gun down to prevent dooms day, leaving Eve alive using Aya's body. Aya was the protagonist from the first 2 Parasite Eve games while Eve was the heroine of the 3rd game, thus the outcome kinda mind screws you regarding this trope

Ending D of Nie R has the player character sacrificing his entire existence in order to bring Kainé back to life after the Shade Tyrann takes over her body.

In case you don't know exactly what that means, the D Ending of Nier is the last ending you can possibly get in Nier. It is the last ending because getting it erases your entire save file piece by piece as Nier himself is erased from existence. It's pretty hardcore.

If you play the good Karma final mission against the beast in In Famous 2, Cole's actions will led to every conduit's as well as his own demise. The people of new Marais will honour and remember Cole as a hero for his deeds.

The lone wander of Fallout 3 dies if you take the 'good' path, this was fixed by the add on broken steel.

If you choose to fight the emperor, Starkiller in Star Wars: The Force Unleashed will die fighting the emperor to buy time for the resistance to escape. Though he "indirectly" got Better in the sequel.

An interesting case in Xenoblade Chronicles. The protagonist Shulk was technically dead since long before the story began, only being kept alive by the god dwelling within him, who was also the one who killed him in the first place. When said god leaves his body, he becomes truly dead, but has his life force restored by a more benevolent god shortly after.

Visual Novel

Shirou dies at the end of the Heaven's Feel route of Fate/stay night (Unexplained Recovery in one ending). Saber dies at the end of the route she's the heroine in, after being sent back to her own time and giving up on the Grail.

Webcomics

Captain Kaff Tagon and Seargent Schlock in Schlock Mercenary (arguably the two primary characters) are killed and stripped of all memories/former self, respectively. Averted via time travel.

...eventually. The strip ran for quite a while looking like leadership of the Toughs was going be by Kevyn, with a degree of awkward mentoring from Tagon's father. Technically, the time travel was mostly required to avert the death of everyone in the galaxy.

John Egbert's physical self in Homestuck ends up getting killed by Jack Noir. He gets better when his Dream Self replaces him, and in fact this event allows him to reach the god-tiers... and then his god-tier self is also easily killed by Jack Noir. Fortunately, god-tiered characters have conditionalResurrective Immortality.

All of the kids and all of the trolls die at least once. As of the current plot a lot of people have died twice, and most of these second deaths have proved to be permanent.

Act 6 invokes this trope with the apparent death of a newly introduced main character. After about a month, it turned out that she actually did not die, but the fact that the event came out of nowhere certainly shocked readers.

Western Animation

Avatar: The Last Airbender: Aang is killed by a lightning blast to the back from Azula. While Aang was ressurected a few minutes later, his death had disastrous consequences. Namely, the Fire Nation took over the Earth Kingdom (their only obstacle to world domination besides Aang himself) and Aang was rendered unable to use the Avatar State until the final episode.