Have you read up on cognitive behavioral therapy?
A short summary would be that a lot of it is caused by entrenched thought patterns and toxic routines. So a question of what input you process how. Its often not caused by chemical imbalances but what falsehoods you belief and what conclusions you draw from it.