I agree with Jamison who suggests you change something about your "sleep pattern" like change the bed around or sleep in a different room. Right now, it's like you'Ve programmed your brain to panic at bedtime, you expect it to happen and it does. CBT can help with those impulsive thoughts/fears of dying. For instance, ask yourself why would you be dying? You've probably had a check-up with your doc which can reassure you because chances are, you'Re perfectly healthy. So now you need to put that thought into perspective and evacuate it from your mind and then replace it with a more realistic one like "I'm not feeling too good, but it will pass, it's just my mind acting up because it's used to acting up at this time, and I will soon calm down". Seriously, try CBT, it works!