Part 1: Opening the Shell
This means nothing other than that you are meant to hook onto the tail. Once you do, you see Valoo go "What the…?" and Link begins to swing. You need only swing across. After you let go, a large piece of the roof falls on Gohma’s head and its shell begins to crack.
Immediately aim at the roof again. Gohma will replace the rock and Valoo’s tail will slither through. Swing again two more times to fully crack the shell and fight Gohma in his "true" form.
Part 2: Ending the Battle
This part is simpler. Lock-on to Gohma (well, his eye) and use the Grappling Hook. Gohma will be forced over and also be stunned. Wail on it with your sword. Repeat as needed until defeated.
After defeating it, Gohma begins to harden to black rock, then explodes. Link begins to happily dance as a complete Heart Container falls and the lava solidifies. A whirlwind also appears in the center of the room. Grab the Heart Container to boost and restore your health and reappear outside of the dungeon, where the King of Red Lions is.