Now, this can be done in 3 basic ways:
1- Altering the balance between physical and spiritual energies in your chakra by disturbing your physical energy. This is done by producing pain. Pain comes from the body and thus it makes your physical energy fluctuate by "shocking" your body. Because of this fluctuation, your chakra flow experiences a spike. This spike is a disturbance that will dispel other disturbances present in your chakra by unbalacing its flow and reseting it to its normal flow. The higher the pain, the bigger the spike. The more resistant or accostumed to pain your bio is, the less effect this has. Kaguya bios for example have a very high tolerance to pain, making them unsuited for this release method. While genjutsu can mimic pain or any other sensation, it will always pale against real sensations. While Pain is subjective, certain guidelines can be followed.
D Rank Genjutsu: Chipping a Finger (like one does as he bites to draw blood for a Summoning Jutsu)
C Rank Genjutsu: Low level Physical Attacks, Bitting a chunk of your Cheek
B Rank Genjutsu: Low ranked Taijutsu/Freestyle
A Rank Genjutsu: High ranked Taijutsu, Stabbing Yourself in minor muscle, Cutting yourself, Breaking Smaller bones, Low level Burning/Voltage, Painful Cold
S Rank Genjutsu: EIG/Sage level Taijutsu, Breaking Bones, Deep Stabs or cuts, Medium Voltage/Burning, Extreme Painful Cold, Bitting your tongue off
2- Altering the balance between physical and spiritual energies in your chakra by disturbing your spiritual energy. This is done by your sheer will power. Its done by forcefully creating a surge of chakra in your body by spiking your spiritual energy through will power alone, forcing yourself to mold and channel your chakra in a way that will either halt the chakra flow or disturb it. It can be done in 2 ways: through the cannon release technique known as Kai or through techniques that produce a high surge of chakra on your chakra flow.
-In the case of Kai, it breaks genjutsu in a direct proportion to the chakra spent to perform it. This means one needs to spend the same amount of chakra spent to produce the illusion. It counts as a jutsu from the jutsu count, requires 1 handseal and can only be used once per turn. The disruption does not break inheritly passive techniques, namely Walking on Water or Tree Climbing. Some self induced illusions can act as Kai or be designed to act as Kai.
-When we consider high chakra surges as a form of release, you need to have a technique that is at least 1 rank higher than the genjutsu set upon you for the case of elemental or specialized techinques (like Gentle Fist), or 2 ranks for the case of raw chakra techniques. An example of this is Raiton: Chidori Nagashi, an A-Rank full body technique that requires no hand seal and can dispel up to B-Rank Genjutsu set upon you. The principle is that as these techniques, since they require you to release a large amount of chakra from all or most of your tenketsu at once in a less focused manner, will, when one uses enough chakra, overcome the fluctuation set on the chakra flow, reseting it to its normal flow. Because this method needs one to overpower the fluctuation set on the chakra flow, you need to spend more chakra than what was used to induce the illusion. However, not all chakra burst-type techniques fall under this rule because of their own specific characteristics. An example is the opening of one of the Eight Inner Gates. Upon opening, the sudden release of chakra disturbs any genjutsu affecting you.
3- Altering your chakra flow through the introduction of foreign chakra or energies. This can be done by an ally who is capable of using the chakra transfer technique or by entering, for example, sage mode or being a jinchuriki in control of your bijuu or releasing a Curse Mark. The reasoning is that as foreign chakra enters your system or another energy (natural energy), your chakra flow becomes altered and unbalanced and thus releases the genjutsu. This enables the release of any Genjutsu except Mangekyo Sharingan grade Genjutsu.
All of these methods produce a reset-like effect on your chakra flow, making it return to normal and dispelling the Genjutsu. However, one most not forget that for a release to be valid, it ALWAYS needs to be partnered with a logical and reasonable explanation of how, from your bio's RP perspective, you figured out it was a Genjutsu/Illusion and thus felt the need to release from it. Releasing from it by "luck" or "because i know its a genjutsu" without stating the why isn't valid.