Well, "happy" or "sad" is all up to interpretations no? I think it has more to do with characters than actual end to story for me. Depending on how much a character went through, you sometimes want to just scream "LEAVE ____ ALONE!"
As examples, I'll use Tokyo Ghoul and Parasyte. Both of these have really dark themes. The difference is that one gave the main character some form of hope at the end, while the other destroys them as a person and bring them back as someone else completely.
The two could have easily reverse their outcomes of course, with Parasyte, Shinichi could have lose his girlfriend at the end and in Ghoul, they could have save Hyde's life.
Either way, both are really solid stories and both decided to screw up the main character's lives royally. While I didn't like the "everything is okay" at the end theme in Parasyte,
I kinda did hope that Hyde'd be spared just so Kaneki would at least have someone there.
I guess I want something along the line of "the environment is still a mess, but at least have someone else there to help with the burden?" I'm guilty of wanting to kill off everyone whenever I do my own stories too though.
I choose the well-written sad ending, but not to the point where my favorite character dies or a love interest of theirs dies, then I will also be quite sad and be unhappy with the ending.
While I do enjoy tragedy, I like it much better when something awful happens, but the person or people are not alone and still have each other to pick up the broken pieces in the end.
Reason:
If an ending feels like someone in charge got done with the series / died and got replaced by an orc, who duck-taped whatever he liked to the ending, then it doesn't feel like an ending. It doesn't feel like you've finished a series, but more like you switched to something else part-way and no one bothered telling you.
I'm mostly thinking of Mirai Nikki (mild spoilers ahead), cuz it changed tones at least twice. First there's the death game + yandere gf, then there's character development for everyone which felt peaceful even with all the murder going on (ffs, stop trying to kill my dad, i'm trying to talk to him). And lastly there's.... whatever the ******** happened after the orc with the duck tape got his way.
Just between those two? I'd pick a well-written sad ending because I don't like endings that answer every question in the series. Happy endings tend to do that. I'd like for it to leave behind something for the audience to think about, like a cliffhanger ending. I'd like to think I'm not just a voyeur waiting for the series to hand out everything to me.
Between a happy and a sad ending, the latter would address that more effectively.
I'd pick better writing 100% of the time. It annoys me sometimes when something dramatic is about to happen in an anime...only for everything to turn out fine like the crisis never happened. I like it when characters have to make a sacrifice, then carry on. I think there are sad endings done badly and good endings done well, but I'll take a sad good one over "oh nevermind nobody died ever and all their suffering means nothing because it was aaaall a dreaaaam" or some such bull
Spoiler examples->Good ending that was sad? Death Parade. Much feels, good impact. Good happy ending? Fushigi Yuugi. The characters that exist in the "real world" are not the same, but reincarnations of the ones in the book, so the characters' sacrifices still mean something. Bad sad ending? Chrono Crusade. Everything seems like it was for nothing. Bad happy ending? Naruto.<-spoiler end
Although I'd prefer happier endings, if it's done right a sad one is fine.
What hasn't been mentioned yet is the third option, that I absolutely hate. Open-ended endings! scream Stuff like "read the manga" in an anime, or a harem anime where the main character doesn't choose. "To be continued" is not an acceptable ending. Resolve your plot, people!
Like Pokemon, gdi Ash grow up, become a gym leader/champion, let someone new be a main character! This is the show that never ends...
Since this was brought up, I feel a well-written conclusion means all major plot points are resolved so the audience can focus on the message behind the anime's themes.
For longer movies, especially, I prefer happy endings. Most of Studio Ghibli's masterpieces (Spirited Away, Princess Mononoke, Howl's Moving Castle, Castle in the Sky, Kiki's Delivery Service...) had happy endings. Some are light in humor, so you are getting what you expected. Some take you for a ride of emotions, so a happy ending feels necessary for bearing through it. And well-written happy endings move the audience just as well when nested within an absorbing, awe and wonder-filled world.
But for series, where you are able to process really gripping and depressing climaxes at your own leisure (20 minutes to an ep), I think it's harder to appreciate happy endings because they end up feeling like filler episodes, especially if the overall mood of the series is heavier. I felt the darker endings of Psycho-Pass and Death Note served to prolong the emotional lows of their climaxes, and in that way, could be more interesting than a full-reversal. But in Psycho-Pass, there remained the possibility of a brighter outcome, and I don't think it would have suffered if
Tsunemori had saved Kougami from his tragic fall.
I think the sad ending there was actually the easier of the two endings, and for that reason, a well-written happier finish might have been more impressive.
Personally, I think the ending of the first season of Ronin Warriors is one of the best happy endings out there. I could literally watch Ronin Warriors all day and be happy with the finale.
Then the best sad ending out there is Android Kikaider (the anime) where Jiro defeats Dr Gil once and for all, but at the cost of destroying his brothers and he walks off into the forest resigned to always be alone.