I am with polara71 I usually can't sleep when work and personal life both are stressful or trying to problem solve, and my brain won't shut off.
Here is my best remedy, I usually always have two books I'm reading at the same time. One's a history book kind of dry, can put you to sleep on its own, also a more enjoyable easy read.
I read the history book if I wake up in the middle of the night and can't fall back to sleep. I find the enjoyable read is better at getting my mind off the stresses of the day . I read it in the evening, science fiction or fantasy works the best for me, because you can completely escape reality for a while.
I enjoy mystery and detective books too, but I find they don't help me sleep, because my mind ends up trying to solve the mystery or case.