In this kind of fanfic, one possible scenario could be that Harry uses his quick thinking and magical skills. For example, he might use a stunning spell on the troll just in time to stop it from harming Hermione. Another scenario could be that Harry lures the troll away from Hermione, using his knowledge of the troll's behavior. Maybe he throws something noisy in the opposite direction to draw the troll's attention.
One reason could be that the troll is simply on a rampage and Hermione was in the wrong place at the wrong time. Trolls are not known for their intelligence, and it might have just stumbled upon Hermione while wandering the Hogwarts halls.
His courage becomes more evident. By saving Hermione, he shows that he is willing to face great danger for his friend. This act of heroism can make him more confident in his abilities as a wizard.
Well, it could start with Hermione being in a vulnerable situation, like being cornered by the troll in a dark, damp dungeon. Harry, being the brave hero, arrives just in time. He might first distract the troll by conjuring up some annoying little creatures that the troll would start chasing. Then, when the troll's back is turned, Harry would grab Hermione and apparate them both to a safer place, like the Gryffindor common room.
Well, in many such fanfictions, Harry might use his magic skills. He could cast a powerful stupefy spell on the troll to stop it in its tracks and then quickly lead Hermione to safety. Maybe he also uses his quick thinking and knowledge of the Hogwarts corridors to find a hiding place where the troll can't reach them.
One possible plot twist could be that the troll is actually under the control of a dark wizard. So when Harry saves Hermione, they realize that there is a much bigger threat at hand. Another twist could be that the troll turns out to be a transformed Hogwarts student, and they have to find a way to reverse the spell instead of just fighting it.
One possible scenario could be that in this fanfiction, Harry discovers that Hermione is being bullied by some dark - minded students at Hogwarts. He steps in immediately, using his skills and the respect he has among his peers to put an end to it. Maybe he threatens the bullies with exposure to the professors if they don't stop.
Maybe Harry uses his magic skills to immobilize Ron. He could cast a spell like 'Petrificus Totalus' on Ron right when he's about to attack Hermione, thus stopping the beating.
In my version of the fanfic, Harry was in the Gryffindor common room when he noticed Ron's strange behavior towards Hermione. Ron seemed to be in a trance and was about to lash out at Hermione. Without hesitation, Harry jumps in front of Hermione and uses a Patronus charm to repel Ron. The Patronus, in the form of a stag, charges at Ron and knocks him back. Harry then holds Hermione's hand and leads her through the secret passages of Hogwarts. As they run, Harry tells Hermione that they need to find a way to break whatever spell or curse is on Ron. They end up in Dumbledore's old office, where they start to search for answers in the old books and magical artifacts left behind.
Well, in many fanfics, Harry might use his quick thinking and swimming skills. He could have found Hermione using his magical connection to her or by following the signs in the underwater maze. Maybe he used a spell to break whatever was binding Hermione and then swam her back to the surface.