Insomnia can be a nightmare. Here's what you can do about it.