If the game freezes, just click inside it (games can get unresponsive if you click elsewhere on the page).
Gather all the diamonds. Go up to the surface to breathe.
Repeatedly tap Z to swim Forward and X to swim Backward. Use Left and Right Arrow Keys to turn. Press C to get back into the boat and refill your air.