A chemical imbalance may be involved.
But better biochemistry doesn't necessarily produce better living/feeling.
Depressed emotional/behavior state < -- > biochemistry. [can spiral upward or downward together]
A psychologist/ licensed counselor / psychotherapist [ i.e., "talk therapy ] can be really important to help your cognitive processes, keep you on track with reality checks. "Meds" are not magic bullets, do not kick in immediately, and it may take several tries to find one that helps you. Meanwhile, if you don't have sufficiently supportive/sophisticated social network around you, it's important to pay for an experienced professional. Been there. Best of luck.