One cannot completely eliminate negative moods states and thoughts. However, learning mindfulness can help you by changing your relationship to your feelings/thoughts.
By being mindful you can learn to watch your feelings without acting on or becoming/fusing with them. Mindfully being aware of feelings without amplifying them and making them larger than the moment can alleviate depression, anxiety or other negative affective experiences.
Mindfulness can also help by providing you with the skills to manage negative emotional experiences (ex: anger or anxiety) that can impact relationships.