In battle Edit
Insomnia prevents the Pokémon from being afflicted by sleep and Yawn. Rest will fail when used by the Pokémon.
A Pokémon with this Ability will wake up if it is asleep in battle (such as if it gains the Ability outside of battle or by an effect like Skill Swap, or is put to sleep by a Pokémon with an Ability like Mold Breaker). If the Pokémon is holding a Chesto Berry or a Lum Berry, it will be eaten before Insomnia wakes up the Pokémon.
If a Pokémon with this Ability is drowsy due to Yawn, when it would fall asleep the Ability activates and keeps it awake.
Outside of battle Edit
If a sleeping Pokémon gains Insomnia by evolution or the Ability Capsule, it will not wake up until sent into battle. Pokémon with Insomnia will not be put to sleep by the Gentleman's Kirlia in the Battle Pikenor the Battle Arcade's game board.