One possible storyline could be that in a final battle against Voldemort, Harry sacrifices himself in a way that no one could reverse. For example, he might use a powerful spell that requires his life force to destroy the last of Voldemort's Horcruxes. Another could be that he succumbs to a dark curse that was placed on him long ago, which was dormant until a certain event triggered it. Maybe a character that was thought to be an ally actually turned out to be a double - agent and cast a fatal spell on Harry.
Another idea is that there is a prophecy that requires Harry's early death to save the wizarding world in a different way. He discovers this prophecy and, being the selfless hero he is, willingly accepts his fate. His death then triggers a series of events that lead to a new era of peace and harmony in the wizarding community, but his friends and allies still deeply mourn his loss.
Some fanfictions in this vein might explore the idea of legacy. Harry, knowing he's dying, could be concerned about how he'll be remembered. He might try to pass on his knowledge and values to the younger generation at Hogwarts. It could also show the impact of his illness on his relationships. His relationship with Ginny might be strained as they both struggle to deal with the reality of his situation.
It could be due to some kind of self - sacrifice he made in a previous battle. For example, he might have used a very dangerous spell that had a side - effect of slowly killing him to save his friends or the wizarding world.
Another storyline could involve a disease or a curse. Maybe Luffy contracts a rare and incurable illness during his adventures. As he gets weaker, he has to come to terms with his approaching death, and his crew struggles to find a cure while also dealing with the emotional turmoil.
Perhaps in the fanfiction, Weiss dies in a tragic accident. For example, a malfunction in her weapon during a critical moment causes an explosion that she can't avoid. Her death then becomes a catalyst for the rest of the team. Ruby might become more determined to fight against the forces of evil in Weiss's memory. Blake could struggle with guilt, thinking she should have been able to prevent it. Yang might become more reckless in her anger at losing Weiss.
In a fanfiction of Naruto dying of a sickness, perhaps the sickness is a result of overusing his chakra during a great battle. His body starts to break down, and he begins to experience weakness and fainting spells. Hinata, being his wife, is desperate to find a way to save him. She might turn to her own clan's secrets in hopes of finding a cure. At the same time, Naruto tries to train Boruto in what little time he has left, passing on his values and skills, while also coming to terms with the fact that he won't be there to see his son grow up fully.
Perhaps in a more dramatic storyline, Rachel is the victim of some sort of malicious act. Maybe there's a rival at a performing arts school who is jealous of her talent. This person sets up a situation where Rachel is put in danger, like a faulty stage setup during a competition. She gets hurt and later dies, leaving the Glee club to seek justice for her while mourning.
One possible storyline could be that she sacrifices herself to save her friends in a battle against a powerful enemy. Maybe she uses all her chakra to protect the village from a massive attack and as a result, her life force fades away.
One possible storyline could be a powerful new enemy emerging. This enemy could be a long - lost primordial being. They manage to overpower Percy and Annabeth in a battle that was unexpected. Maybe they were lured into a trap where their powers were nullified, and they couldn't fight back effectively. Another storyline could be a self - sacrifice. For example, to save their friends or the whole of Camp Half - Blood, they choose to face a great danger alone, knowing that they won't survive.
One possible plotline could be that Harry is dying from a mysterious dark curse. His friends, like Hermione and Ron, are desperately searching for a cure. They might travel to far - off places, seeking ancient magic or the help of powerful wizards. Another plotline could be that Harry is sacrificing himself for the greater good, perhaps to defeat a new and powerful dark force. His slow death could be a time of self - reflection and him saying goodbye to his loved ones.