When you’re unable to sleep, it can feel all-consuming. Here, a perspective shift and two practices for such times.