Does overthinking cause depression?

A friend of mine, If she had any problem then that time she used to think about that, and spend her time in the same thing. By doing this, her health is also not good and she is sad all time and remains alone and also suffering from headache problem, is it okay for her health? Is overthinking is affect life with depression? Need suggestion to solve this problem