there sometimes is no remedy for sleeplessness. Counting sheep or drinking coffee, reciting poems or reading something in between often doesn't help.
You simply have to sit (lie!) it out without angry thoughts.
Have a peaceful night this night,
es fand im Schäfchenkreisverkehr
der Schäfer keine Ruhe mehr.
So kamen deine Verse in mir an...
very often I could not sleep. Here is my tip for you: Take a deep breath, hold and count to eight. Exhale and count again to eight. Repeat 11 times.
Just see what happens.