Several years ago I learned that pain itself can cause discouragement. My back had been injured and I could not stand stationary for more than a few minutes without pain, I also could not sit very long without pain. I could walk, and lie down in relative comfort. My physician sent me to a pain psychologist who explained that physical pain actually uses up body chemicals that elevate mood. He said that pain depletes serotonin, that it's a physical process.
The first thing you need to do if you've been feeling down/discouraged is to reduce and eliminate, if possible, any physical pain you've been dealing with. People often try to ignore pain, to "tough it out" thinking it's a mind over matter thing--which to some extent it is--but one needs to know how to do the mind over matter techniques that actually work.
There has been quite a bit of recent research in understanding pain and how to reduce and eliminate it. So, if you are in pain, ask for help, consult a pain specialist if necessary, to make it easier and quicker for you to elevate your mood and consistently feel good again.