Depression in itself is not a problem. Depression is a warning. It is a warning that our thoughts and actions are somehow misguided. Depression essentially arises when we spend too much time brooding about ourselves and our lives, and is generally a symptom of self-centredness, a lack of concentration, or pure boredom.
Just like physical pain, feelings such as depression are signals that we should feel grateful to receive. We do not need to panic because we feel depressed. Usually we just need to relax and stop brooding or dwelling on ourselves. Or perhaps we need to stop criticising others. The time delay between a negative thought or action and the resulting depression will become smaller as we become more in tune with ourselves, making it easier to spot the cause of our depression.