Combat / Targeting
From the main menu, select System and open the Character Configuration menu. Select the Target tab, and under Target Settings, check the box next to "Disable targeting of pets and minions when in battle."
With this setting active, pets and minions are no longer selectable as targets during combat, which can be helpful if you find yourself accidentally targeting your companions in battle.