This is the first boss of the game and she's not too hard, as her attacks are limited to only two. When you arrive in the room, look up or target with the Slingshot to begin the battle. One of her attacks involves getting close to you and trying to fall on Link, which can simply be blocked with your shield. Queen Gohma's other attack involves her going onto the ceiling and releasing three eggs, which will hatch into Gohma Larvae when they hit the ground.
The Deku Scrub in the previous room mentioned about "attacking her while she's stunned." In order to stun her, you need to use a Deku Nut or the Slingshot to hit her in the eye when it turns red. This will make her vulnerable to attack, so start hitting her with your sword. Keep doing this until you kill her, which won't take too long. After the battle, collect the Heart Container (adds a full heart to your health) and go into the blue light to be transported out of the dungeon.