Perhaps a little bit cliché but a very good thing to keep in mind. Things never go perfectly all the time. Those of us who want or need things to always go perfectly are likely avoiding many chances to leave their comfort zone. Relationships have highs and lows, sometimes everything is great and sometimes not as much. Jobs are the same thing, as long as you are challenging yourself at all, it will not always be easy.
See problems as opportunities. By changing the way you speak to yourself, you change your world. The next time that you hit a low in any part of life, say to yourself “this is an opportunity to…” and finish the sentence with an opportunity that will change your life.