Some people find that Trazedone helps them sleep.
I have had insomnia most of my life, but it was much worse when I was younger. I sometimes went several nights in a row without any sleep - can't remember the last time time that happened.
I take Zopiclone (think it's the same as Ambien in the US) very occasionally. It mimics a benzodiazepene (i.e. Valium), but is not a benzodiazepene. It doesn't give any high, but does give one a bit of a hangover. But preferable to a really bad night of no sleep.
But I have really had to jump through hoops to get the prescription. I've been told that the Ministry of Health has advised doctors to be wary of prescribing it, because of the opioid crisis - which makes no sense, given that Zopiclone is not an opioid.
In the 2000s, before the drug was seen as a 'bad drug', I took it every day for several years. I slept well and maintained a routine for those years, and was highly functional. But would doctors care about that? No, because it's a bad drug.
I had found that doctors don't care very much about insomnia. I've been told to have a warm glass of milk, or take a bath.

If it were just that simple, I wouldn't have the complaint.
And as you say, insomnia is a really common problem. I understand that doctors are to 'do no harm', but they don't seem to understand how debilitating going without sleep can be.