Take the long view. Instead of trying to cure the problem all in one race, try taking smaller steps. For example, since cycling is a team sport, set a goal to help your teammate succeed. Come away from the race with a feeling that you made a difference for your team. It may not feel like a lot, but it is a viable starting point.
You should look for other opportunities to take steps towards your goal of improvement and winning (e.g., improving your time trial time on a particular course rather than winning) instead of attempting to attain your goal all at once.
Maintain your emotional perspective. It's always a good thing not to get overly excited when things are going well or to fall off an emotional cliff when you are not achieving your goals.
Remind yourself that whatever is happening now, good or bad, will not last. This mental approach is most important during the low points of your season. Know that things will improve and will not remain down too long so long as you can maintain some balance in your reactions. Expect that you will have lower morale at times. If you expect it, you can handle it better.
Know Thyself, Motivate Thyself
Maintaining good morale is a question of understanding how you respond to different types of circumstances. For example, if you lose contact with the pack during a race, does that motivate you to ride harder or to give up and save it for another week? Neither response is wrong, but if you know yourself, you will minimize the negative self-judgments that can bring us down.
In addition to knowing yourself, having some experience with the ebbs and flows that are a common part of cycling can really help. When I first started racing, I would enter my events feeling good and thinking I could do well, but not having much success, which led to disappointment. After learning how important tactics are to bike racing and how to apply them more effectively, I slowly began to improve, which in turn led to winning for both my team and myself.
I learned that there was much more to bike racing than the physical side and my experience was a pretty normal response to the stresses of racing. Like so many things in life, maintaining positive morale is an ongoing quest involving knowing yourself and knowing that your struggles are not just unique to you ... everyone has them ... even Lance Armstrong!
While we may all share the process of struggling, everyone has a different set of strengths and weaknesses, and we all progress at our own pace. Getting on a program with a coach that understands you as an athlete and individual can help you not only to think like a winner, but to become one!