If you recall, on the night you became Champion, you visited Tapu Koko’s ruins with Hala and the others. While leaving the ruins, Tapu Koko briefly materialized, which was telling you to come back here later. When you’re ready to face the tapu proper, travel back to Iki Town, via Charizard or other means.
Back in town, head for the exit to the far north that leads to Mahalo Trail. From there, follow the trail all the way up to the top, towards the Plank Bridge. Earlier, the bridge collapsed when you tried to rescue Cosmog. However, at some point in time, before you challenged the Pokémon League, the bridge was repaired.
Anyway, go across the very sturdily-made bridge towards the other side of the ravine. After crossing, head east for a moment to find an Electric Seed on the floor. This held item boosts Defense when Electric Terrain is triggered, which Tapu Koko is excellent at doing. Next, proceed north to reach the entrance of the ruins.
There’s nothing really exciting outside, so carry on north into the ruins itself. Inside, follow the empty hallway towards the end, then enter the doorway to get to the altar. Finally, go up the stairs on either side to reach the top of the altar. After you’ve saved your game, inspect the tapu statue to meet Tapu Koko once again.
Tapu Koko is a formidable foe that possesses exhilarating Speed and solid offensive stats, but below average bulk. At the start of battle, its Electric Surge Ability will trigger Electric Terrain, boosting the power of Electric-type moves and preventing Pokémon from sleeping–but only for Pokémon touching the ground.
For attacks, it can use Discharge and Electro Ball for STAB–the former can cause paralysis, while the latter deals more damage to slower foes. It can also use Nature’s Madness to halve your Pokémon’s HP, and Agility to boost its Speed. Agility and Electro Ball can be a painful combination for slow Pokémon.
Against this tapu, Ground-types are ideal since they’re immune to its STAB attacks. However don’t go crazy with the super-effective attacks because it’s not great at taking hits. After whittling Tapu Koko down, your best bet is to send it to sleep, seeing as it’s an an Electric-type and this naturally immune to paralysis.
To do so, you’ll need to wait until Electric Terrain disappears from the field, after the fifth turn. Otherwise, Tapu Koko will be so shocked that it literally cannot fall asleep. Afterwards, it cannot activate Electric Terrain again, so you’re free to keep sending it to sleep. From here, you just need patience and a lot of Ultra Balls, etc.