I too have trouble sleeping at times due to pain, meds causing achiness, and my dreaded thoughts. I take alprazolam sometimes. Sometimes Benedryl. Mirtazapine works best though. It seldom fails. If I have two bad nights in a row, I take a very small dose because I am affected by medication. My dad took mirtazapine, too. I take it early on in the evening, about an hour and a half before I plan to go to bed. It works very well for me. I have taken gummies with THC, but without, I think it is CBD, because it makes me zippy. I found myself cleaning the bathroom at night, not something I ever do, nor do I want to do. My stepson finds chamomile tea puts him to sleep. I have a bunch of sleep stories that I listen to. Usually, they help. I find them on YouTube: Calm has a few, Jason Stephenson...try them and see what might work for you. UCLA has an app and I like that one too.
I hope you find something to help you.
Thank you. I’ll look into the mirtazapine.