If the target creature is an illegal target when Kogla's first ability tries to resolve, the ability doesn't resolve. If it's a legal target but Kogla is no longer on the battlefield when the ability resolves, the target creature won't deal or be dealt damage.

Artwork
Loading artwork…
Kogla, the Titan Ape
Ikoria: Lair of Behemoths · #162 · EN
Nonfoil—Foil—
Card rules
When Kogla enters, it fights up to one target creature you don't control.
Whenever Kogla attacks, destroy target artifact or enchantment defending player controls.
1
: Return target Human you control to its owner's hand. Kogla gains indestructible until end of turn.
7/6
Rare · Illustrated by Chris Rahn
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If the target Human is an illegal target by the time Kogla's last ability tries to resolve, the ability won't resolve. Kogla won't gain indestructible.