Not getting the required amount of REM sleep is one of the biggest challenges facing adults today and it is on the rise. It causes accidents in the workplace and on the roads and is a strong contributor to anger and depression.
Part of the problem lies in the environment we've created affecting sight and sound and the brain is a complicated organ and very responsive to light stimulation. Make your room as dark as you can, you get up in the middle of the night don't turn on the main light, keep a small flashlight and don't let it reflect into your eyes or your brain is going to think 'it's morning'.
I use a sleep machine and have it set on the steady drone of white noise and have experimented with different levels to discover the best to drown out the ambient sounds and not draw too much attention to the sound machine itself. I did find the sweet spot through experimentation. Their are also sleep apps but I find I need a deeper more resonant sound than a phone or pad can deliver.
Might make you pee but try a herbal tea an hour before bedtime and soak in a warm, not hot, tub, get out, dry off and go straight to bed and turn the lights out. Don't watch TV, read and most of all look at a computer screen, smartphone or pad. Go to bed at the same time every night and up at the same time as much as you can to train your brain. Erratic hours stimulates the brain too much and you want it to know when to shut down and when to power up.
I haven't found anything to work all the time but I have found that staying in the bed and tossing and turning increases frustration and I have an area cleared out in the den where I can pace or walk in an elliptical circle and think the thoughts I can't stop thinking. I find that the physical act of walking helps the thought pattern.
Here's another thing I have found that helps. I seek the perfect sleep position and even talk it out loud. I have a couple of herniated discs so I have to sleep on my side with a pillow between my knees or back with a pillow beneath my knees and I talk though every movement and tell myself that's perfect. I keep the room at 68, never higher, and find that adds to the comfy feeling that being in bed should give us.
Sorry about the length of this but I know just how frustrating this can be and too many docs just want to throw drugs at it and some, like Ambien, have caused more problems than insomnia. Maybe the FDA should force them to take these meds for a while before prescribing them so freely. Hell, we're all test subjects to see which company is going to have us as a customer. This entire opioid problem with the pharm companies and docs is a national disgrace. Don't get me started on that.