If you don't know how depression occurs then you are likely to fall on it. Since, if we don't know the cause of problems, then we can't solve them. Thus, considering depression, the following are the steps of its occurrence:
You may create a thought for some events or activities in your day to day life.
After getting thought, your mind processes it with the help of the programming of your mind.
If you have negative programming on your mind viz. negative belief system on your mind you may likely create negative thoughts which are always imaginary thoughts of your mind, differ from real thoughts.
Due to differences in real and imaginary thoughts, you may create overthinking in your mind.
After continuously doing the same practice of overthinking ultimately you may create depression by which your happy hormone suppresses, and the level of depression increases on a daily basis.
Ultimately major depression occurs and finally suicidal thoughts come and life may cease.