News flash - discouragement, hopelessness, fear of failure, and shame do not work. They are dead ends. Period. I hesitate to even put these words down visually - they don't need any attention whatsoever, but the truth is we are human and are going to go there from time to time. So be extremely nice to yourself while you are there. You could just say, "Wow self, this is suffering. I am sincerely sorry we are in this dark place right now." Then as soon as you can - get the hell out of there, literally!
On the other hand frustration is quite helpful. This is important to distinguish. Did you know that babies do not learn to crawl, walk, or talk without first being frustrated? I think many of us are familiar with the infant/toddler screaming from their highchair because no one understands what they want! (This is frustrating for everyone involved!) Thus normally, they will learn to communicate to get what they want. So remember frustration=motivation. I often tell myself this when I am feeling frustrated, "This must mean I need to grow in some way. How can I improve?" or, "I must be progressing." Whatever we do, do not allow our frustration (which is part of life and progressing) take us to "the dark places," if at all possible.
Another much more important news flash - the opposites of the above (not to be named again) concepts; trusting that all will work out, self-love, confidence, hope, and gratitude are our only real options. So just practice them, allow them, and try it out.
Trust: Did you know that when the space ship Voyager was about to exit our solar system they turned the camera around and took a "selfie" of our planet and sun family? The results were incredible and have stuck with me ever since I heard the story. Once they got the pictures back, they looked for and identified all the planets (and of course the sun) ...almost as an afterthought they looked for the earth and do you know what it looked like? A teeny tiny dust particle in a giant sun ray. And that is only from the edge of our own solar system! See! INCREDIBLE! Right? So that gives me every reason to see "the bigger picture" we are part of something much larger than we can understand and so I can trust and realize that this planet and all of life is an amazing miracle. I do not need to fear. There is much more going right than wrong. I can trust, trust, trust, away. As for the other concepts; self-love, gratitude, hope, and confidence, I will focus on them another time, but for now - trust me, they work.