If you can't sleep, then get up and do something instead of lying there worrying. It's the worry that gets you, not the lack of sleep.
It may take practice to think more positively and more compassionately, but just as you must train a puppy to behave the way you want it to, you must train your mind to behave itself. Otherwise, like the puppy, your mind will just make a lot of messes.

