Before needing to be saved, Hermione could be a damsel in distress waiting for Harry. Maybe she got caught by some magical trap set for the second task participants.
Hermione might play the role of an unwitting victim. She could have been exploring the underwater area for the second task, being too curious for her own good. And she might have stumbled upon something she wasn't supposed to, like a hidden magical mechanism or a group of unfriendly magical creatures that captured her, which led to her needing to be saved by Harry.
In the fanfic, before being in a situation where she needs saving, Hermione could be in the middle of solving a part of the second task on her own. She might be trying to figure out a riddle or find a particular object underwater. But then, something unexpected happens. It could be that she accidentally triggers a protection spell that was set up around the important item she was looking for. This spell could have incapacitated her, making it necessary for Harry to come to her rescue.
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.
Well, he could use his magic skills. Maybe he casts a powerful spell on Ron to stop him and then takes Hermione to a safe place, like Hogwarts where there are protective enchantments.
She could research about the dragons' species and their habits. By knowing what scares them or what attracts them, she can give Harry useful tips. For example, if she finds out that a certain type of music calms a particular dragon, Harry can use that during the task.
Snape's brooding and mysterious personality might work in Hermione's favor. His intimidating presence alone could deter some of her enemies. People in the wizarding world might be afraid to cross him, so they would think twice before harming Hermione if they knew Snape was protecting her.
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 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.
In a Game of Thrones fanfic, Hermione could be a mediator. There are so many conflicts in Westeros, from the Stark - Lannister feud to the battles for the Iron Throne. Hermione, with her logical mind and ability to see different perspectives, could step in and try to broker peace deals. She would use her communication skills, honed in the wizarding world, to get the warring parties to at least listen to each other and consider alternatives to all - out war.
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.
Hermione's character could develop in terms of her relationships. Through saving Fred, she might form a stronger bond with the Weasley family. She may also become more empathetic as she experiences the fear of losing someone dear. She realizes that there are things more important than just academic knowledge. So, she starts to balance her intellectual side with her emotional side more effectively.
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.