The best way to avoid depression is to engage in a healthy and stress-free lifestyle. Having supportive friends and family also helps. Secondary prevention consists of recognising and admitting that one suffers from depression and seeking treatment for it. The treatment would include counselling sessions and psychotherapy along with a prescription for drugs. Tertiary treatment consists of rehabilitation.
Depression is a recurring illness.
A person who has been completely cured could still be susceptible to another attack of depression. Assuming a positive outlook to life and being confident about oneself could be one's only shield against depression.