סימן קצד סעיף ד
כֵּיוָן שֶׁנָּטָה אָדָם לָמוּת, אֵין שׁוּם אָדָם רַשַּׁאי לִפָּרֵד מִמֶּנּוּ, שֶׁלֹא תֵצֵא נַפְשׁוֹ וְהוּא יְחִידִי, מִפְּנֵי שֶׁהַנֶפֶשׁ מִשְׁתּוֹמֶמֶת בְּשָׁעָה שֶׁיוֹצֵאת מִן הַגּוּף, וּמִצְוָה לַעֲמֹד עַל הָאָדָם בִּשְׁעַת יְצִיאַת נְשָׁמָה, שֶׁנֶאֱמַר, וִיחִי עוֹד לָנֶצַח לֹא יִרְאֶה הַשָּׁחַת כִּי יִרְאֶה חֲכָמִים יָמוּתוּ, וְגוֹ'. וְרָאוּי לְקַבֵּץ עֲשָׂרָה, שֶׁיִהְיוּ בִּשְׁעַת יְצִיאַת נְשָׁמָה, וְלֹא יַעַסְקוּ, חס וְשָׁלוֹם, בְּדְבָרִים בְּטֵלִים אֶלָא יַעַסְקוּ בַּתּוֹרָה וּבַתְּהִלִּים וּבִשְׁאָר מִזְמוֹרִים, כִּמְסֻדָּר בְּסֵפֶר מַעֲבַר יַבֹּק. וְנוֹהֲגִין לְהַדְלִיק נֵרוֹת בִּפְנֵי הַגּוֹסֵס.
From the moment that his death is imminent, no one is permitted to leave him, so that his soul does not depart when he is alone, because the soul is shocked as it departs from the body. It is a mitzvah to stand by a person, as the soul is departing from him, as it is said, "Shall he then live forever, shall he never see the grave? For he sees that wise men die, etc."4Psalms 49:10–11. It is proper to gather ten adult males to be present at the departure of the soul. They must not God forbid engage in idle talk, rather they should engage in Torah subjects, and in the recitation of Psalms and other supplication, as arranged in the seifer, Maavar Yabbok. It is customary to light candles in the presence of a dying person.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)