The Laws of Bedtime Shema
Rabbi Yochanan Eskenazi
The Gemara [Berachos 4b-5a] states even though one has already recited krias shema shel arvis in shul, there is a mitzvah to recite krias shema when going to bed. The Gemara elsewhere [Berachos 60b] adds, someone who goes to sleep should recite Shema from Shema Yisroel until V'haya im shemoa [i.e. the first paragraph of shema] and then say birchas ha'mapil.
This obligation applies to men (Shulchan Aruch 239:1). There is a dispute whether women are obligated. The opinion of the Magen Avraham [239:2] is women are exempt because it is a mitzvas asei she'hazman grama (positive, time-bound commandment). However, most Poskim argue and hold that since the main reason why Chazal established krias shema al hameetah is for protection, women also need protection (Shaar Hatziyon 239:16 & Aruch Hashulchan 239:6). There is an opinion that women are not required to recite the entire krias shema al hameetah, rather it suffices to say just the first paragraph of shema, birchas ha'mapil and the paragraph of v'hee no'am (Shu"T Teshuvos V'Hanhagos 1:198). As an aside, saying krias shema al hameetah is a segula not to miscarry (see Shu"T Teshuvos V'Hanhagos 1:198). On a similar note, saying krias shema al hameetah serves as a protection from mazikim (spiritual damaging forces) (Aruch Hashulchan 239:3).
Children are not obligated in krias shema al hameetah, however, the Ben Ish Chai writes that one should accustom his children to say itfor this will bring him a lot of yiras shamayim (Halachically Speaking 1:pg. 137).
The Gemara [Berachos 60b] only mentions two things that one is required to say: the first paragraph of Shema and Birchas ha'mapil. The implication of the Shulchan Aruch [239:1] is that this is all one is obligated to say. This is also the opinion of the Aruch Hashulchan [239:6]. The Mishneh Berurah [239:2] adds there are opinions that hold that it is preferable to recite all three paragraphs of Shema [together with the words Kel melech ne'eman or repeat the words Hashem Elokeichem emes] in order to recite 248 words, which helps protect all 248 limbs of the body. Additionally, there is a minhag to add additional pesukim and mizmorim (Rema 239:1) in order to increase our protection that no bad come to a person (Mishneh Berurah 239:9), including improper thoughtswhile we are sleeping (Aruch Hashulchan 239:1).
In terms of the order of recitation, it is a machlokes rishonim which one should be recited first. Most Rishonim hold that one should follow the implication of the gemara and first say krias shema andthen recite the bracha. The opinion of the Rambam [Hil' Tefillah 7:1] is one should first say the bracha. The Mishneh Berurah [239:2] suggests that each person should act according to his nature. If he normally falls asleep while saying krias shema, then it is preferable to first say birchas ha'mapil. If he thinks he can remain awake, then it is preferable to recite krias shema first.
As an aside, the Mishneh Berurah [4:36] writes when a person goes to sleep, he should have in mind that the reason why he is going to sleep is in order to have more strength to serve Hashem. With this mindset, the actual time sleeping is considered a mitzvah. Additionally, some have the custom that before going to sleep they place their hand on the mezuzah (Halachically Speaking 1:pg. 143 writes that this was the minhag ofHarav Moshe Feinstein zt"l).
Each night before one goes to sleep, it is proper for one to make a cheshbon ha'nefesh (personal accounting of one's soul) and forgive others that did wrong to him (Mishneh Berurah 239:9). Even if one does not normally make a cheshbon ha'nefesh during the year, during the Aseres Yemei Teshuva (Ten days of repentance), it is proper to (Mishneh Berurah 602:3).