The end result is the same, too. Current medical advice is a mix of sleep hygiene and meditation strategies (some insomniacs feel extremely anxious when they can't sleep, which makes things worse) and medication.
I'm currently not taking medication, but for many years it was a pretty constant cycle 6-9 months on medication, and then a few months tapering off because my body would quickly build tolerance to them. Medication was pretty critical when I was in college, but in the decade since I've graduated I think I've just come to see the cycle as unsustainable and ultimately kind of pointless which is why I haven't taken them for about a year now.