"I can't believe I never thought of that! Thank you, Dr. Friend!"
But the Reality Is ...
Sleeping pills don't work. Yes, in some cases they can help, but it's a temporary fix that doesn't last long. Not only does your body eventually build up a tolerance to the medication, but coming off of it can induce even stronger insomnia. It's called the rebound effect, and it's a lot like a playground bully finding your hiding spot, grabbing your underwear, and pulling it around your neck while yelling, "You think you can hide from me?! There is no escape, bitch! I will wedgie your fucking corpse!"
Of course, you could always go the prescription route. What could be safer than medication, closely monitored by a doctor? Not taking any medication at all. According to that link, "Researchers found that people taking prescribed sleep medications were almost five times more likely to die over the 2.5-year study, compared with those who didn't take sleep medication." Given, I don't know the details of the actual deaths. For all we know, those could have been people mainlining Ambien while watching Pink Floyd the Wall.
"It's like ... the wall wasn't just a physical wall, man. Wild."
But the point is that if you're the one handing out advice to someone who has the disorder, the chances of your "it's obvious to me" solution being 1) something they haven't already tried, or 2) something a doctor hasn't already thought of are pretty close to zero. If the solution were easy, insomnia wouldn't even be a thing. We'd all be sleeping so hard, our beds would have bruises.