Maybe Harry uses some powerful and unexpected spells. For example, he could combine the Patronus Charm with a blasting spell. The Patronus might distract Voldemort while the blasting spell hits him hard.
Well, in some fanfictions, Harry might use some hidden magic he discovers in Azkaban. Maybe he finds a way to turn the Dementors' power against Voldemort. Since Dementors can suck out a person's soul, Harry could somehow direct them towards Voldemort, weakening him enough to deliver the final blow.
After Harry kills Voldemort in the graveyard in the fanfiction, the magical balance might shift. With Voldemort gone, some of the dark magic that was prevalent might start to fade away. The Hogwarts School of Witchcraft and Wizardry could see a new golden age. New spells and magical theories might be explored as the fear of Voldemort no longer holds back the wizarding scholars. Harry himself might start to travel around the world to spread the news of Voldemort's defeat and also to learn more about different types of magic. His friends would also have new opportunities, like Hermione might be able to further her studies without the constant threat of Voldemort and Ron could finally relax and enjoy a more peaceful life at the Burrow.
Harry might use his wits and the environment around him while in captivity. For example, if he's held in a place with magical artifacts, he could use them to his advantage. He could break the chains that bind him with a spell - enhanced object and then make his way to Voldemort and defeat him.
In fanfiction, Dumbledore could have set up a series of trials or quests for Harry before the final battle. These experiences make Harry stronger both magically and mentally. Dumbledore might also have a secret plan that he has been preparing for years. He could be using his own powerful magic in a covert way to weaken Voldemort over time, like gradually breaking down the protection spells around Voldemort's Horcruxes so that Harry can find and destroy them more easily.
It's possible that there's a hidden stash of Muggle items in Hogwarts, and Harry stumbles upon it. He discovers the gun there, realizes it could be a powerful weapon against Voldemort, and decides to use it.
If Voldemort kills Harry in the graveyard in fanfic, it would completely change the course of the story. The wizarding world would likely fall into total despair and chaos. Voldemort would have no real opposition left, and his reign of terror would be absolute. Wizards and witches would be living in constant fear, and the values that Harry represented, like love and friendship, would seem to have been defeated.
Well, in many fanfictions, Harry might use a combination of his existing skills and newfound powers. He could use his Parseltongue ability to communicate and perhaps distract the Basilisk, and then strike it with the Sword of Gryffindor. Another way could be that he uses some sort of spell he's been secretly practicing that gives him an edge in the fight.
The wizarding world would likely be in a state of shock and then celebration. People would start to see Azkaban in a new light, perhaps no longer as just a place of horror but also as the site where the great evil was finally vanquished.
One way to make it engaging is to introduce new characters who emerge in the power vacuum left by Harry's death. Maybe a secret group of wizards who have been hiding their powers all along. Another aspect could be to delve deeper into Voldemort's psyche. Why did he choose the graveyard? What does it symbolize to him? And then, show the small acts of resistance that start to build up, like a spark in the darkness.
Perhaps Voldemort has some inside help. He could have bribed or threatened one of the guards or even a Ministry official who has access to Azkaban. This person could then help him get in and break Harry out. Or he might have found a secret passage into Azkaban that the Ministry doesn't even know about, and he uses that to his advantage.