Fate/stay night. Any ending that can remotely be considered "happy" is earned in gallons of blood, sweat, and tears. Mostly blood and tears, actually.
In Tsukihime, Hisui's Good End, which is still rather bittersweet, and Kohaku's end. Kohaku's end gets the benefit of looking like not only did this path's heroine just die, but you'll have to kill Akiha because Roa is corrupting her. But neither happens.
Air has you go through all of the character endings in order to get the Dream ending where Misuzu dies as a result of the curse placed on her previous incarnation Kanna and Yukito lives on as a crow. However at the very end of it, and it's shown in the anime, you see two children playing on the beach, wondering about what Yukito and Misuzu have in store for their future. It is shown that these are reincarnations of Misuzu and Yukito who will live out their lives happily. In fact, the little girl holding the unknown hand that is used as the logo for Air is shown to be this incarnation of Misuzu and the hand she is holding is Yukito's.
In CLANNAD, to obtain the True End, where Nagisa and Ushio do not die, you must obtain every other Light Orb in the game, a.k.a. near 100% Completion of each other route. Some of them are pretty tricky: Misae's could only be obtained when you play Tomoyo's route IMMEDIATELY after Misae's route. It's the scene at the Founders Festival, where Misae is looking for her cat, a.k.a. Shima Katsuki.
Little Busters requires the player to have gone through each of the other girl's route in order to have Riki and Rin become stronger and even after you have gained access to the refrain route it requires you to have Riki live through the 'real' events where the bus crash killed everyone but him and Rin, and then fix that reality so everyone lives
G-Senjou no Maou is designed as such: If you want to get the final, 'true' ending you have to have had the opportunity to access every other route in the game during a single playthrough and pass it up. This means playing the game for as long as possible, and averting every chance to take an alternate route and walk away from the Devil's games. At which point the game goes on to subvert it because said ending leads to the main character's entire family dead, his foster father dead (although nobody will probably miss that one), the main character disgraced and spending eight years in the slammer for murder (to say nothing of the backlash of having a mass-murdering terrorist for a brother), and several hundred people dead during the chapter 4 riots. On a lighter note, he does get some extra Character Development and the Victorious Childhood Friend out of it. So, um... Yay?
Ookami Kakushi also works in a similar manner, where, in order to unlock arc after arc to obtain the story's true end where none of the main characters die, the Kamibito and the Ochibito take a step towards co-existence, the village is not destroyed, and even the villain gets something resembling a happy end even though he will eventually go to prison you need to play through all the endings in the other arcs, including the bad ends.
The final chapter of The Reconstruction is the Darkest Hour, where the plot has gone completely Off the Rails and the world is in ruins. To make matters worse, an all-powerful "Lord-God" is sweeping up the remains and killing any survivors. The main characters are the only remaining hope for the world, but many of them are incredibly scared and nervous that they'll fail — after all, how will they be able to kill a god?
In Yume Miru Kusuri, both Kouhei and the chosen heroine go through many, many trials together (such as horrific bullying, drug-addiction and existential crises), but they eventually resolve their problems and go forward together to a well-deserved Happy Ending.
Katawa Shoujo: All of the routes involve some deal of angst, but two routes stand out amongst the rest. In Lilly's route, she seems to go off to Scotland and Hisao runs after her only to have a heart attack and appear to die. Even when you realise he's still alive he's stuck in a hospital again with an even more reduced lifetime knowing that Hanako is happy away with her other friends and that Lilly is gone forever. At least, until you hear the music box and Lilly reappears, promising to stay in Japan and with Hisao. Secondly, in Rin's route, which is as a whole noticeably darker than Act 1 and the other routes, she goes through a slow spiral into depression in her attempt to create art and find herself and doesn't really snap out of it until the very end, leaving many players to become convinced they've accidentally gotten a Bad End.
Hanako's past is so heartbreaking that it's very gratifying to see her get a happy ending. Her mother died to save her during that fire when she was a kid, said fire disfigured the right-hand side of her body, kids (even the ones that were her closest friends) in the orphanage bullied Hanako because of her scars, and she's so lonely (partially by choice, though). During her Good Ending, she thought that she had ruined any chance with Hisao, but then Hisao tells her that he loves her.
Togainu no Chi. Akira has a lot to go through; most endings has him killed horrifically, raped to death, or go insane, his best friend Keisuke always takes Line and goes insane, in three routes he's killed because of Akira's blood, gives his life to save Akira in another route, and almost dies in his own. Then there's Shiki's route, where he is sexually and emotionally tortured, developes Stockholm Syndrome, and the possible endings are somewhat depressing. Either a) Shiki goes insane and Akira turns into a sex addict, b) the two of them join the military and set out to conquer the world, or c) Shiki becomes a vegetable which Akira takes care of. The last one is the canon "good" ending and is very bittersweet. Thankfully the drama CD implies Shiki is waking up.
In Phoenix Wright: Ace Attorney, Phoenix has to take on four seemingly impossible cases, go through all sorts of stress and hardships to win them, suffers the blow of his mentor being murdered, and ultimately has to tackle a case so difficult, it went unsolved for fifteen years. But it all pays off in the end, when all the clients are found innocent, von Karma is proven to be the guilty party behind the DL-6 Case, and Edgeworth realizes that his father's death was not his fault.
In the last trial of Justice for All, Maya is kidnapped, and Phoenix is given the Sadistic Choice of getting his client (who actually is guilty, for a change) off the hook, or having Maya be killed by her kidnapper. As Gumshoe, Mia, Edgeworth, and even Franziska scramble to find some way to catch the kidnapper and save Maya, Phoenix finds himself having to either abandon his ideals and pin an innocent woman with the crime, or let Maya be killed. All the while, his reputation plumets as the audience of the courtroom has no clue why he continues to defend a man who's obviously guilty. At the very end though, thanks to last-minute evidence scrounged up, he's able to get the kidnapper to release Maya and turn on his client.
In Apollo Justice: Ace Attorney, Phoenix is disbarred, framed for using forged evidence, and reduced to playing poker at a restaurant to make a living. He spends several years quietly investigating the truth behind the case he lost, putting all the pieces together. And by the end, the truth is revealed, he's proven innocent of forging evidence, and is able to retake the bar exam and become a lawyer again.