There are many times in the Psalms we are told to be thankful (Psalm 30:4; 50:14; 92:1; 95:2; 100:4; 105:1; 136:6; etc.). Paul tells us in 1 Thessalonians that thanksgiving is a part of God’s will for each one of us.
Secular studies have shown that those who are more grateful also have a more positive outlook on life.
From a Harvard Medical School article they say:
In positive psychology research, gratitude is strongly and consistently associated with greater happiness. Gratitude helps people feel more positive emotions, relish good experiences, improve their health, deal with adversity, and build strong relationships. (1)
One simple way to overcome negativity is to become more thankful. When you are emotionally down it may be hard to feel thankful.
But if you will look at thankfulness as a command and try to be thankful because God tells you to be thankful, it may make it easier to pull out of the mood you are in.
I Thessalonians 5:18 “In every thing give thanks: for this is the will of God in Christ Jesus concerning you.”