This is an hymn by Isaac Watts, his Hymn 80 of Book 2, published in 1709.
Settings by composers
Text and translations
An evening hymn, by Isaac Watts, 1809, based on Psalm 4:8, 3:5,6, and 148:8
Thus far the Lord has led me on,
Thus far his power prolongs my days;
And every evening shall make known
Some fresh memorial of his grace.
Much of my time has run to waste,
And I perhaps am near my home;
But he forgives my follies past,
He gives me strength for days to come.
I lay my body down to sleep,
Peace is the pillow for my head;
While well-appointed angels keep
Their watchful stations round my bed.
In vain the sons of earth or hell
Tell me a thousand frightful things
My God in safety makes me dwell
Beneath the shadow of his wings.
Faith in his name forbids my fear;
O may thy presence ne'er depart!
And in the morning make me hear
The love and kindness of thy heart.
Thus when the night of death shall come,
My flesh shall rest beneath the ground,
And wait thy voice to rouse my tomb,
With sweet salvation in the sound.
add links here