The Helmasaur King is the Boss of the Dark Palace in A Link to the Past as well as the Palace of the Four Sword in A Link to the Past (GBA exclusive).
Firstly, Link must remove the Helmasaur King's mask by hitting it with the Hammer. It is also possible to use bombs, but the Helmasaur King will most likely have moved away by the time they explode. However, if you obtained the bomb upgrade from the fairy, it is suggested that you stick with bombs since they shatter his mask far quicker than the hammer. If Link stands right in front of it, he will be safe from its tail, but if it opens his mouth and fires three fireballs at him, stand in-between the lower two and inline with the top one. They will each split into four, but it should be safe.
Once its mask is gone, the Helmasaur King will reveal a green spot which Link must hit with arrows. Its attacks do not really change, but it will start to move a bit quicker, making it harder to hit. After about seven hits with arrows on the green spot, the Helmasaur King will be defeated.
Palace of the Four Sword
In the GBA version of A Link to the Past, the Helmasaur King makes an appearance in the additional game, Four Swords. There are several differences between the A Link to the Past boss in the Dark Palace and this second encounter with the now green beast. A similar strategy is pursued to destroy its mask, but after this point, the Helmasaur King produces blue Helmasaurs rather than emitting fireballs from its mouth. Once its gem is sufficiently damaged, a second mask will appear and the process is repeated. After this is done, a third eye will appear on the Helmasaur's King's forehead. A Silver Arrow will terminate the beast once and for all.