Change your preferences here.
The user is immediately KOed, then the Pokémon switched in heals all HP, PP, and status. Any events that would occur after the user's turn do so after the new Pokémon is switched in.