Dealing with the cause of the stress is the obvious answer. If that's not possible, relaxation techniques or just doing something to distract yourself as you fall asleep (be that counting sheep, imagining your dream holiday, reading a book - whatever, as long as it works works for you) can help, as can writing down whatever is stressing you out.