Walkthrough:The First Trial is set by Captain Ilima in Verdant Cavern on Melemele Island, who you will be approached by when you near the cave off Route 2. Once you are sent into Verdant Cavern, you must find three Pokemon in the cave area. When you find them, the first two being Alolan Rattata, you will be forced to Battle each of them since they will attack you, which each will be at Level 11. Like all Trials, the Pokemon found within them cannot be captured at that given Time.
About halfway through the Trial, Team Skull will appear and try to distract you with a Battle. Defeat them, and you'll then be able to find the third Pokemon, Alolan Raticate, which will also be at Level 11. After defeating the third and final Pokemon, you will have to face the Totem Pokemon, which is another Alolan Raticate, but this Time at Level 12. As you enter battle with it, the Totem Pokemon will have its Defense increased by one stage. The Totem Pokemon, Alolan Raticate, can also call upon help, which in this case will be other Alolan Rattata at Level 11.
Defeat all of the Pokemon in the Totem Battle, and you will have completed your first Island Trial, the only of which found on Melemele Island. You will then be given Normalium Z, your first Z-Crystal, and then you'll be shown how to orchestrate a Z-Move by Professor Kukui himself. From there, you can return to Verdant Cave to capture the Pokemon within, or head to Route 3 that has now been opened for you so you can head back to Iki Town to face Kahuna Hala for your Melemele Island Grand Trial.