Rabbi Chaim Vital, the primary student of the Ari (Rabbi Yitzchak Luria), outlines the Kabbalistic framework of the human soul — its five levels (nefesh, ruach, neshamah, chayah, yechidah) — and explains how purification of the body and soul is the path to attaining the higher mystical states.
נודע אל בעלי מדע, כי גוף האדם איננו האדם עצמו מצד הגוף כי זה נקרא בשר האדם, כמו שכתוב (איוב י' י"א) עור ובשר תלבישני ובעצמות וגידים תשוככני, ועוד כתיב (שמות ל' ל"ב) על בשר אדם לא ייסך וגו', נמצא האדם הוא הפנימיות, אבל הגוף הוא ענין לבוש אחד תתלבש בו נפש השכלית אשר היא האדם עצמו בעודו בעולם הזה, ואחר הפטירה יופשט מעליו הלבוש הזה ויתלבש בלבוש זך ונקי רוחני, וכמו שכתוב (זכריה ג' ד') הסירו הבגדים הצואים וגו' והלבש אותך מחלצות, הוא הנקרא חלוקא דרבנן: וכמו שלבוש גוף האדם יעשהו האומן בתבנית איברי הגוף כן עשה הוא יתברך את הגוף שהוא לבוש הנפש בתבנית דיוקן הנפש ברמ"ח אברים ולהם שס"ה גידים המקשרים את האברים, ולהמשיך על ידם הדם והחיות מאבר אל אבר כדמיון צנורות, ואחר יצירת הגוף נפח בו נפש חיה כלולה מרמ"ח איברים רוחנים ושס"ה גידים, ויתלבשו תוך רמ"ח איברים ושס"ה גידים, של הגוף ואז פועלים איברי הנפש פעולתן על ידי הכלים שהם איברי הגוף כגרזן ביד החוצב בו, והראיה לזה כי לא יפעלו איברי הגוף פעולתם אלא בעוד הנפש בהם עין רואה ואוזן שומעת וכו', ובהסתלק הנפש חשכו הרואות בארובות ונתבטלו כל החושים מרמ"ח אברים:
As known, the physical body of man is not his actual identity. It is merely called human flesh, as in the verse, “You clothed me with skin and flesh and covered me with bones and veins.” Furthermore, it is written, “It may not be applied to the flesh of man etc.” From this we understand that man is the inner aspect, whereas, the body (the flesh) is similar to a garment. The intellectual soul of man, which is his true identity, is invested in the body as long as he remains in this physical world. However, upon death, he is divested of the garment of the body and instead, becomes clothed in a spiritual, rarified and pure garment. This is as scripture states, “Remove the soiled garments from upon him;” and he said to him, “Behold, I have removed your iniquity from upon you and dressed you in a pure garment.” This garment is called, “The Raiment of the Rabbis.” Just as the tailor makes a garment according to the form of a person’s body, so HaShem-יהו"ה, blessed is He, made the body, which is the garment for the soul, in the form of the image of the soul. That is, He made 248 organs plus 365 veins and arteries that connect them. The blood and life-force surge from organ to organ by means of these arteries that are similar to pipes. Once the body was formed, HaShem-יהו"ה blew the spirit of life into it. This spirit is comprised of 248 spiritual organs and 365 spiritual veins that are invested within the 248 organs and 365 veins of the physical body. With this, the organs of the soul act through the organs of the body, which are their tools, like an axe in the hand of the lumberjack. Proof of this, is the fact that the physical organs only perform their functions so long as the soul resides within them; the eyes see and the ears hear etc. However, upon the departure of the soul, the eyes dim and all sense and feeling vanishes from the 248 organs.