Except that's not solving the problem, that's temporarily addressing the symptom. Hypnotics should not be taken lightly or for extended periods of time. Drugs may help at first but they're not the solution for sleep issues. You need to address the underlying problem.
Seeking medical attention is the first step to addressing the underlying problem though. You need to get the rest you need in order to work on deeper issues.