Depression can hit anyone and prevention is not something that one can rely on. Let's say your most cherished person suddenly is killed, how would you PREVENT depression in this case? You can't, all you can do is cope and overcome depression. Some use drugs,(which can make things worse or kill you), others go to counseling, and then others throw themselves into something that takes their mind away, if only for a while, such as meditation. With meditation the more you practice and take your mind away, the better the results. It also works as a coping mechanism.
1.Take a rest when you are tire. A bath, a good sleep, a comfortable walk may help.
2.Don't always sit in front of your computer. Do more exercise (very important).
3.If you feel depressed, find a right person to talk to.
Find 2 or 3 sports you like and do them on weekly basis.
Find 2 or 3 good causes and volunteer for them.
Start cooking healthy foods.
Stop watching the hate mongering and fear mongering Big Media, specially that sewage of humanity called Fox.
I believe that depression can be prevented by staying as mentally active as possible which includes trying out new hobbies, participating in family and social activities and keeping a positive attitude at all times!