- You may be looking for the episode "The Host".
A host is a lifeform affected to some degree by an invasive or exotic entity. A host and symbiont relationship is the most common form. In such a situation a symbiont is an organism that becomes part of the host's resources – including (but not limited to) mind, thoughts, emotions, or body. In some situations the host's resources are shared and the host considers the relationship unwanted. This type of relationship is considered parasitic. Both of these types of these relationships require a host that the invasive entity deems appealing for some reason.
In 2266, James T. Kirk implored Doctor Leonard McCoy to find a way to kill the Denevan neural parasite without also killing the host. He later recorded a captain's log denoting his reluctance to kill the Denevans despite having a prerogative to do so rather than risk the parasites spreading further. (TOS: "Operation -- Annihilate!")