Bedtime Shema - Kriat Shema Al Hamita
There is a mitzvah in the Torah, in the very text of the Shema itself - to recite the Shema twice daily: "And you shall speak of them . . . when you lie down and when you rise up." The sages explain that this means we are to recite the Shema every morning and evening.
Shema is included in the morning and evening service. Yet the Talmud states that before one goes to sleep, he should recite the Shema, as well as Hamapil. Hamapil is both a blessing and a prayer, in which we acknowledge that G‑d has made us slaves to sleep, and we pray to Him to help us have only good thoughts in our sleep and to awake in the morning.
Since the Shema is a standard component of the nighttime Maariv service, what is the purpose of repeating it again?
Proper Frame of Mind. The Talmud explains that one should recite Shema before going to sleep, so as to go to sleep with words of Torah on his lips. This is learned from the verse in Psalms, "Quake and do not sin; say [this] in your heart on your bed and be forever silent."
Protection. Additionally, the recitation of the Hamapil after the bedtime Shema serves as a protection from evil thoughts and impure forces (both physical and spiritual) during the night. Sleep is described in the Talmud as one-sixtieth of death. The absence of life creates a vacuum which draws in forces of impurity and unwanted thoughts. Shema provides us with extra spiritual vitality to overcome this.
Early Maariv prayer. Some congregations have the custom to hold the evening prayers early, after sunset but before nightfall (or even earlier on Fridays). While this is permissible and they have fulfilled their obligation with regard to evening prayer, they did not yet fulfil their obligation to recite Shema at night, since it needs to be said after nightfall proper. Thus, saying Shema at bedtime has an unintended dividend. Those who pray in these congregations can have in mind during the bedtime Shema to fulfill their obligation to recite the evening Shema (provided that they say all three sections of the Shema).
Additions to the Bedtime Shema. The Talmud relates that the sage Rabbi Yehoshua ben Levi, in addition to reciting the Shema, would recite Psalm 91 as protection before he went to sleep. Following this, many have the custom of reciting this psalm, as well as various other verses, together with the bedtime Shema. (These prayers can be found in most standard prayerbooks.) Additionally, many have the custom to add formulas in which we forgive all those who may have wronged us and ask G‑d to forgive us for our sins.
Finally, the way one goes to sleep is the way he or she wakes up in the morning. So if you go to sleep with the Shema, you’ll be able to wake up reinvigorated to start a productive, meaningful and spiritual day.
With Goodness I Shall Sleep - (A Short Film About Krias Shema Al Hamita) By Rabby Ezra Shochet