Shabbat morning prayers end with singing Adon Olam, by far the most well-known liturgical poem (piyut). It dates back to the 13th century, part of the golden age of medieval Hebrew poetry.
Adon Olam is about God's eternal existence, Creation, and trusting God in times of trouble. One of the concluding lines is, "In His hand I entrust my soul, when I sleep and when I awake." The mention of sleep has led scholars to think that the original intention was for Adon Olam to be sung or said just before going to sleep. Indeed, Adon Olam is part of the Bedtime prayers.
Rabbi Eliezer of Worms writes that whoever recites the first lines of Adon Olam with intensity will be protected from temptation and danger, which shows that already in the years just after its composition, rabbis saw the poem as a great source of religious inspiration.