It isn't true every morning, but I often wake up and give thanks to the Lord for a good night's sleep and for His protection while I slept. I seldom have trouble sleeping (except during those dreaded years of perimenopause that every woman hates) and I am grateful for that gift.
The psalmist, David, slept in some unusual places too. Unlike me, he had every reason to think that he could awaken at any moment with a sword at his throat and his enemies gloating over his soon demise. It's a wonder he slept at all during those years he was pursued by Saul!
But I have a sneaking suspicion that David wasn't just thinking so much about physical danger when he wrote: "I will lie down and sleep in peace, for you alone, O Lord, make me dwell in safety" (Psalm 4:8). I take that from what precedes this verse. In the beginning of this short psalm, David calls on the Lord for mercy and makes a plea for those who hear his words to leave behind their sin, their "delusions" (vs. 2) as he calls them. And then he calls on them to do this: "In your anger do not sin; when you are on your beds, search your hearts and be silent. Offer right sacrifices and trust in the Lord" (vss. 4, 5).
David had several opportunities to kill Saul. He had every reason to be angry at Saul for the unjust treatment he had received at the king's hand. No one would have blamed him if he had hated his persecutor. But he didn't. Perhaps that was one reason he slept so well at night—a clear conscience will do that. It reminds me of the children's prayer: "Now I lay me down to sleep, I pray the Lord my soul to keep. If I should die before I wake, I pray the Lord my soul to take." David went to bed knowing that both physically and spiritually he was right with His God.
The other reason—a more powerful one I'm sure—was that David had complete trust in the God he followed. It made no difference whether an army was hot on his trail or he was asleep in the rich kingly bed of the palace surrounded by guards. He knew that God was watching—the God who doesn't doze off at the midnight hour or need to seek His own bed to catch a few winks. "...He who watches over you will not slumber; indeed he who watches over Israel will neither slumber nor sleep...he will watch over your life..." (Psalm 121:3, 4, 7).
Heading to bed with clear conscience and a worry-free mind because we know that our God watches over our lying down and our getting up (Psalm 139:2, 3) is a better sedative that anything that ever came out of a pill bottle.