Genjutsu is the second subcategory of Jutsu used in NV. The other two being Ninjutsu (physical use of chakra) and Taijutsu (hand to hand). Genjutsu, like Ninjutsu, also uses chakra to employ itself in battle. Some genjutsu also require hand seals to mold the necessary chakra for usage. The basic principle of genjutsu is to manipulate the opponent's chakra flow in their body (specifically the brain) causing their senses to be manipulated and changes. The principle use of genjutsu is to manipulate one's sight and hearing. However other genjutsu can go further and manipulate smell and touch. This is unlike taijutsu and ninjutsu because both of these are based on the principle of causing direct physical damage.
Genjutsu is most commonly used to create false impressions for the body which can lead to a number of occurrences such as false images and pain. The pain can be caused by genjutsu because pain is something the mind experiences. If you fool the body into believing it is in pain, the mind will respond accordingly.
Genjutsu requires one to have a high intelligence and very keen observational skills. If one does not use both of these skills then the targeted victim of a genjutsu will be able to recognize and take the necessary actions to escape it. Probably the most famous user of genjutsu I can think of is Itachi Uchiha. His Tsukuyomi, a dojutsu of the Mangekyo Sharingan, was capable of manipulating a person's sense of time within the genjutsu making 1 second appear as 3 days.
To escape a genjutsu one must first be able to recognize that they are in one. There are many genjutsu that are easily recognized. However some are extremely subtle and require keen knowledge and understanding of how the genjutsu works. There are three methods of escape from a genjutsu.
The first is Kai - Release.
A genjutsu can be released through Kai by disturbing one's own chakra flow. Additionally if you have a partner in a battle with you they can use this technique on you by touching you and disturbing your own chakra flow as well.
The second method to releasing a genjutsu is physical pain. By causing your own body physical harm outside of the genjutsu world you bring your mind back to its senses. However the stronger the genjutsu used the more pain is required. An S-ranked genjutsu would require you to slice deep into your body, almost severing important arteries. This can be almost fatal.
The third and final way to release a genjutsu is to release chakra from all over your body. This will act as a way to disrupts its flow as well. One jutsu that will allow for this to work is this:
Finally, the most noted genjutsu dojutsu is the Sharingan. The Sharingan is capable of producing many genjutsu without eye contact which is what many regular genjutsu require. Additionally, Sharingan users are able to pierce through genjutsu easily and see through its manipulative effects. Rinnegan users and Byakugan users will also be able to recognize when one is under the effects of a genjutsu because their chakra flow will be strange and different to them.
I don't think I missed anything

. Apologies if I did!