No need to remove endophytes from the plant tissues, as it's the normal flora of the plant and will not affect your desired results. However, you can use different techniques such as heat, UV, and chemical-based methods after removing epiphytic microbes. Moreover, you can add some antibiotics (fungal and bacterial) to halt their growth in the media.