To combat the effects of genjutsu, there are several options:
*The ninja needs to stop the flow of chakra in their body, and then apply an even stronger power to disrupt the flow of the caster's chakra; this is called Genjutsu Dissipation . This can also be done by an unaffected ninja by applying a sudden surge of chakra into the affected person.In addition, tailed beasts can break their jinchūriki out of genjutsu in a similar fashion if they have a good enough cooperation, as seen in Killer B's case.
*Another is through intense pain not caused by the genjutsu and utilising the resulting pain to bring their senses back in order (of the first two options, the latter seems more effective in most situations, or at least is the easiest).
*Another option is accessible only to Sharingan wielders. Members of the Uchiha clan can break or see through genjutsu using their Sharingan. Breaking Tsukuyomi is possible with an ordinary Sharingan, but requires a lot of skill.
Sharingan wielders can also use their dōjutsu to liberate each other from genjutsu. Through eye contact, they are able to literally insert themselves into each other's genjutsu freely allowing them to break whatever genjutsu it is that imprisons their comrade.
The Byakugan is also noted to be able to tell when genjutsu is being used.
*.Ordinary people can sometimes train their eyes (without Sharingan) to break genjutsu through unknown means, like Deidara.
One can prevent a person from casting genjutsu using obstructive techniques like the Hiding in Mist Technique to prevent one from being trapped by an ocular genjutsu as Zabuza demonstrated against Kakashi.
winer is Minato but this wuld be hard fight.