This post contains affiliate links.
Did Sin Cause My Depression?It is true that some of the hardships we encounter are a result of sin and so sin can cause or worsen depression and sometimes it's not related at all. It's not usually one sin that causes an illness but many sins over a long period of time. However that's not what you should be worrying about. The cause of your depression for the most part is irrelevant. It's what you do with that depression.
If they were more aware of how sinful is their overvaluing the world, failing to trust God, having bitter thoughts of him and meager, unholy thoughts about his goodness, and devaluing the glory of heaven (which should give them some solace even in the most desperate state), as well as their being frequently impatient, worrying, and discontent, and their denying previously received mercy or grace, this would do them more good than words of comfort. - from Depression, Anxiety and the Christian LifeWhat this quote is saying is that by doing those things, you are sinning. Someone telling you that they are sins and that you should work hard to overcome them would be better than just simple words of comfort such as "don't worry, it will be okay." Hope is important but just hoping it will get better is not taking matters into your own hands.
Words of WisdomDon't make the world more important than faith. Trust in God, resist bitter thoughts of God and unholy thoughts about his goodness. Watch your impatience, worry, discontent and don't deny already received mercy or grace or deny that you will receive more.
Sin Doesn't Mean...However just because you might be struggling with sin (as we all are in some way), it doesn't mean that you are not worthy of grace or that God doesn't love you.
On the other hand, if they foolishly imagine that all these sins prove them to be devoid of grace and that God will count the Devil’s temptations as their personal sins, condemn them for the very things they abhor, and reckon their very illness of depression to them as a crime, these notions need to be refuted and discarded. Otherwise, they might mistakenly relish their disordered emotions and sufferings. - from Depression, Anxiety and the Christian LifeGod doesn't count the Devil's temptations as yours, as long as you resist them. God doesn't consider your illness a crime either. God loves you and your imperfections but he hopes you will be able to resist sin and try to live as he would.
Repent of your sin, ask for forgiveness and then work on your illness. It's hard, trust me I know. But you have to take an active role in your depression to get rid of it. It won't go away by itself. God Bless!