The only thing I have found to stop the mental treadmill is reciting scripture. A verse here and a verse there helps some of the time. The more stressful life is the longer it takes. Those times I need a longer passage like Psalm 1. So I make myself quote it straight through without error. If I make a mistake or loose my place, I start over. It was a chapter I studied many times growing up. Reciting it allows my mind to focus and let go of everything. I suppose in many ways it is my life motto. It reminds me of where my focus needs to be all the time not just when I cannot sleep.
Blessed is the man that walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful. But his delight is in the law of the LORD; and in his law doth he meditate day and night. And he shall be like a tree planted by the rivers of water, that bringeth forth his fruit in his season; his leaf also shall not wither; and whatsoever he doeth shall prosper. The ungodly are not so: but are like the chaff which the wind driveth away. Therefore the ungodly shall not stand in the judgment, nor sinners in the congregation of the righteous. For the LORD knoweth the way of the righteous: but the way of the ungodly shall perish.