Tell yourself the story of Christ on the cross. If you don't know the details or if you are really wide awake, read the story in Luke 23. Read a chapter before or after too if you wish. It's a great story.
Tell it or read it a second or third time if you need to. The idea is for the story to eclipse whatever is keeping you awake because the story is stronger than that thing or that thought.
As that story captivates your mind and heart, start thinking of others instead of your own pain or predicament. A lot of other people are awake in the middle of the night too, and many of them are awake because of bitterness. Pray that God will help you spread the forgiveness of the cross so others won't be awake.
Instead of writhing or wallowing in your pain, start reveling in your privilege. You get to help spread the results of the greatest sacrifice that has ever been made! You are carrying the salve for the wounds of the world!
Spread some on your own wounds, and then start thinking what other wounded people you might be able to help, especially any whose wounds you have inflicted or any you failed to notice when you should have.
That is what the Forgiveness Prayer is asking God for. "Make us a channel of your grace, O Lord. We'll forgive. We'll forgive. We'll forgive."
BTW, usually it is God who wants you to relax and sleep but God's enemy who wants to put you into turmoil and rob you of sleep. When the enemy realizes that you are using your wakeful time to focus on the cross and to pray about spreading the benefits of the cross, he would rather let you sleep. So awake or asleep, you win.
Repeat the Forgiveness Declaration, adapted for night use, "This is a night of atonement, and we forgive."
Repeat it calmly but stubbornly. This is more true than whatever you are feeling.
If you are musical, turn it into a lullaby and hum it.
Note that you are not saying you feel forgiven or you feel like forgiving. You are saying you are forgiven whether you feel it or not and you choose to forgive whether you feel like it or not.
Your "feeling meter" cannot be trusted, especially at night, and especially if you are alone. It can give you false negative readings like a broken Geiger counter telling you there is no radiation in the area even though there is. Your feelings may say you are not forgiven. God's Word says you are.
You can trust the Declaration because its foundation is the sacrifice of Christ. Nobody can undo what he did. He took his own blood into the perfect spiritual Temple in heaven, and he sealed your forgiveness with it. (Heb. 9.11-12)
If you are awake because of some bitterness or anger against someone who wronged you, turn the pain and the whole issue over to God. Remember that refusing to forgive is like drinking poison and hoping the other person will die.
If you are awake because you were wronged today and you know the person may do the same thing to you tomorrow, hand your fear over to God. He may or may not change your situation, but he can bring your fears under his control and stop them from dominating your life. He is in charge of your life. Your fears are not.
If you are awake because you have not forgiven God himself for something, perhaps something terrible that you think he would have prevented if he cared about you, read the "agony poem," Psalm 22. Jesus quoted the first and the last verse of it during his agony on the cross.
This site cannot guess all the possible causes for you being awake or give you cures for them all, but the Spirit of God in you knows exactly what they are and what to do about them. If you feel like your prayers are bouncing back at you off the ceiling, remember that the Spirit is below that ceiling. And the Spirit has ears better than your mother.
Picture the problem situation and see whether you can also picture the blood of Christ being sprinkled onto it like priests used to sprinkle the blood of sacrificed animals on people or things to symbolically purify them. How does the situation change when Jesus, as the High Priest, arrives and sprinkles his own blood on it?
If you don't see anything right away, keep picturing it and see whether you can fall asleep. God may send you a picture in a dream.
Caution: the "Picture" method (especially when awake but even in dreams) runs the risk that you will project your own wishes into the situation. For example, if in your picture, the blood creates acid-like burns all over the face of the person who wronged you, you can be pretty sure that idea came from you and not from God.
The pictures or dreams most likely to come from God are the ones that surprise you the most. They are also the ones that will give you a great sense of peace, but not the false "peace" or satisfaction of vengeance.
If the "Picture" method does not fit with the way you are wired, switch back to the "Declaration" or "Story" methods in the other columns.
Falling asleep while praying or listening to a sermon usually means you failed. Here are a few SYNC exercises where falling asleep is sign of success. Try these when you have trouble sleeping.
Ironically all SYNC "exercises" are more a matter of relaxing than of trying harder. As we SYNC with the forgiveness that has been available since Christ sacrificed himself, we quit fighting God and relax into his forgiveness. What better time to get good at these relaxing SYNC exercises than the middle of the night?
Middle of the night
Like dancing or running, SYNCing goes wrong if we try too hard. We have to relax while doing SYNC exercises, and they relax us as we do them.