According to Raja yoga, kaivalya is the final stage of enlightenment that a yogi can reach, also called moksha or nirvana. In this state, the yogi becomes completely fearless and free. Although it is sometimes wrongly perceived as negation or annihilation, kaivalya is a state of total awareness.
A yogi must isolate his/her soul completely from the matter and understand that his/her happiness is not connected to the external word. He/she realizes his/her independence and importance and then achieves kaivalya.
Someone who wishes to attain kaivalya must overcome his/her desires and attachments. A kevalin is free from the modifications of the mind as well. As Patanjali says in the Sutras, "the soul finds its end in freedom, enlightenment and kaivalya."