From previous battles I have experianced, I know this methodes work.
A) When I am aware I am in a genjutsu, or suspect I am in one, I have to harm myself, in order to feel pain. Pain will stabilise my chakra, and help me concentrate into what is real.
B) A Full body chakra source. When not binded inside the genjutsu, I usually use "Raito: illusion of flash pillar" in order to have my body enveloped in my chakra. This stabilises my chakra as well. It can work with any "full body surge" jutsu, like opening the 8 inner gates, activating biju mod, raikage armor etc. There is also a jutsu specifically for that purpose called "kai" or "genjutsu release".
C) An other method is, when an ally perceives you are under a genjutsu, they can insert some chakra to your body, which will also stabilise your chakra.
D) Finally, a sensor skill might help you understand your chakra is disturbed, which is essential in order to break out of a genjutsu (to solve a problem, you first have to know it is there). For example, the Sharingan can break out of genjutsu according to their level of tomoe, and will see chakra, enabling the user to say if someone is under a genjutsu.