There are two phases to the Trinexx battle. In the first phase, Link must fight the fire and ice heads that come out of its body. These heads spit fire and ice respectively, but since the ice that is spit out will stick to the floor, it is recommended that the ice head is taken out first. Use the Fire Rod to stun the ice head and the Ice Rod to stun the fire head, then slash at the heads with the sword. Watch out for the central head, as that can extend out to damage Link. It is recommended to bring a blue potion or a green potion to this battle.
Once the elemental heads have been defeated, Trinexx will reform itself to look more like a snake with a flashing segment. Other than following Link around, Trinexx does not have any other attacks in this phase. After a few slashes at that segment, Trinexx explodes, and the seventh crystal containing Princess Zelda appears.