There's an assumption in the question that I want to challenge here... I'm interpreting your question as "Can an illusionist be effective against high-level opponents with truesight?"

In D&D5E, all wizards select a subclass — most of them are school "specializations", but others exist. Taking a particular school does not bar the character from casting the full range of wizard spells<sup>1</sup>, but give a few special abilities related to the type of magic they're best at.

True enough, your character's *favored* brand of magic would be less effective against creatures with truesight. However, by the time a wizard reaches that level, there should be plenty of other spells in his arsenal. As long as you don't *neglect* other schools, your character should be fine.

<sup>1</sup><sub>In previous editions, specialist wizards lost out on entire schools of magic to make them better in their selected school.</sub>