As Harry's class practices Banishing Charms in Charms the next day, Harry tells Ron and Hermione about Snape, Moody, and his trip to the bathroom. Ron thinks that Snape put Harry's name in the Goblet of Fire, but Hermione insists that they should trust Dumbledore. She's more interested in why Mr. Crouch is pretending to be sick. That night, Harry sends Sirius a letter detailing this information.
Hermione's insistence that they need to trust Dumbledore's judgment shows that even though she's beginning to question the authority figures in her life, some of them--like Dumbledore--are still above her suspicion. This indicates that in this way, she's still a child.
Hermione and Ron dedicate their time to helping Harry figure out how to breathe underwater for an hour. Ron suggests that Harry Summon a diving setup from a Muggle town, but Hermione rejects this idea on the grounds that Muggles would see it. They search the library for a week with no luck and Harry receives a short letter from Sirius, asking when the next Hogsmeade weekend is. Harry writes back immediately that it's two weeks away. In Care of Magical Creatures, Hagrid shows the class baby unicorns and expresses his belief that Harry can complete the task and win the tournament.
The fact that Hermione rejects Ron's reasonably good idea on the grounds that it would jeopardize Wizarding world security shows that though she's still an outsider in many ways to the Wizarding world, she has a better grasp of how things need to function to keep wizards safe than Ron does.
By the evening before the second task, Harry still hasn't figured out what to do. He sits in the library with Ron and Hermione looking through book after book. Hermione seems to take it personally that the library isn't helping. Not long after dark, Fred and George appear and say that McGonagall wants Ron and Hermione in her office. Hermione promises to meet Harry in the common room when they're done with McGonagall. Harry returns to the common room with a stack of books and around midnight, fetches his Invisibility Cloak, creeps back to the library, and keeps searching.
When Hermione is so upset that the library is letting her down, it shows that she still relies heavily on print media to guide how she moves through the world and makes decisions. However, this isn't unique to her: none of the trio consults anyone else asking for help, which shows that they don't yet truly accept that they have their entire community to draw on.
Harry dreams that the mermaid painting in the prefects' bathroom is holding his Firebolt away from him and taunting him. He wakes to Dobby poking him and saying that the second task starts in ten minutes. Harry hopelessly says he can't do the task, but Dobby says that Harry has to get Ron from the merpeople. He gives Harry a slimy ball of what he calls gillyweed and tells him to eat it. Harry races down to the lake and notices the stands set up around it. He's surprised to see Percy at the judge's table and has no time to catch his breath before Bagman arranges the champions at the edge of the lake, checks that Harry has a plan, and blows his whistle.
Percy's presence instead of Mr. Crouch's indicates that Mr. Crouch's health or wellbeing has likely taken a turn for the worse, and Percy is being given even more power because of it. While this doesn't implicate Percy, per se, it's important to keep in mind that this is something that likely makes Percy very happy and, because of his love of power and rules, he's moving into a position where he could begin to abuse it.
Harry pulls off his shoes, shoves the gillyweed into his mouth, and wades into the lake. He stops when he's waist-deep and feels stupid until suddenly, he feels as though he can't breathe. Harry notices that he has gills and dives into the lake, which feels pleasant. His hands and feet are now webbed and it's easy to dive to the bottom. He swims through weeds, looking for any sign of Ron, and a grindylow grabs his ankle. Two more join the first and Harry shoots boiling water at them. He swims away as fast as he can and finally escapes. When he stops to catch his breath, Myrtle scares him and points him in the right direction. Harry starts to hear snatches of the song from the egg and finally comes upon merpeople dwellings and, eventually, a village square.
Again, when Myrtle frightens Harry and then helps him, it shows that Harry has a number of people to call on for help, not all of whom he expects to be able to do anything for him. This is indicative of Harry's youth, immaturity, and adolescent self-centeredness, all of which will begin to disappear as Harry grows and comes of age. Note how the narrator describes the merpeople's village; by showing that they live in dwellings and have village squares, just like humans, it shows that they're relatable.
Hermione, Ron, Cho Chang, and a girl who looks like Fleur's sister (Gabrielle) are tied to a statue in the middle, all apparently asleep. The merpeople do nothing as Harry swims to the hostages, tries to borrow a spear to cut the ropes binding Ron, and settles for a sharp rock. When Ron is free, Harry looks around and starts to cut Hermione's ropes too. Several mermen pull Harry away and tell him that he can't take Hermione. After a minute, Harry notices the merpeople pointing to Cedric. Cedric saves Cho and tells Harry that Fleur and Krum are coming. Minutes later, Krum appears, badly transfigured into a shark. Harry offers shark Krum his rock to cut Hermione free and then Krum swims to the surface.
For all Harry's self-centeredness, it's a mark of how much he cares about other people in general (given that he knows and likes Hermione and Cho but doesn't know Gabrielle) that he insists on staying and making sure they get out safely. This indicates that at least in times that seem dangerous like this, Harry is capable of being empathetic and caring for everyone as though they're his own loved ones.
Harry looks around, waiting for Fleur. He isn't sure how long the hostages have left, so he brandishes his wand at the merpeople and frees Gabrielle. Swimming to the surface is difficult with Gabrielle and Ron, especially since the merpeople circle and watch him. Soon, Harry realizes that breathing is becoming difficult and his flippers are disappearing. With a few feet to go until the surface, the gills and webbing disappear and Harry makes a final effort to make it to the surface. As he pulls Ron and Gabrielle up, the merpeople smile at Harry. Ron spits out water, notices Gabrielle, and tells Harry that he hopes Harry didn't waste time acting like a hero--Dumbledore wouldn't have let anyone die. Harry feels silly as he and Ron help Gabrielle to shore.
When Ron reprimands Harry, he's really taking Harry to task for not thinking critically about the song and not taking the song's context into account. It is of course silly to think that Dumbledore would've let any of the hostages die, given that they're not supposed to be the ones in danger by participating in the Tournament in the first place. The fact that Harry feels silly for taking the song at face value offers hope that, going forward, Harry will take this lesson, internalize it, and learn to engage with context in the future.
Percy, his face white, splashes into the lake to meet Harry and Ron. On the bank, Fleur hysterically screams for Gabrielle and grabs her as soon as she's close enough. Madam Pomfrey snags Harry, wraps him in a blanket, and seats him next to Hermione, Krum, Cedric, and Cho. Krum points out a water beetle in Hermione's hair, but Hermione brushes it away and keeps her attention on Harry. She says that he took forever and Harry feels even sillier for taking the riddle seriously. He watches Dumbledore speaking Mermish with the Merchieftaness. Fleur kisses both Ron and Harry in thanks.
The discovery that Dumbledore speaks Mermish suggests that Dumbledore is more openhearted and willing to accept non-human individuals into his orbit than even Harry has been willing to give him credit for. The fear on Percy's face indicates that, though Ron will at points question whether Percy prioritizes work or family, at this moment in time Percy cares for his family more than anything else.
After a brief conversation with the judges, Bagman announces that they'll award points out of 50. He awards Fleur 25 points, as she didn't reach Gabrielle. Cedric, who returned one minute late, gets 47 points. Krum's transfiguration earns him 40 points, while Harry's choice to save Gabrielle gets 45 points on account of his "moral fiber." Harry is now tied with Cedric for first place and everyone claps. Bagman announces that the third task will take place early in June. As Harry walks back to the castle, he decides to buy Dobby more socks to thank him.
The decision to buy Dobby more socks shows that Harry truly understands the power of these small things to make another being feel seen and appreciated, and he understands that because he has the power and the wherewithal to do these things for individuals like Dobby, it's imperative that he share his wealth and do so.