Spread the Stress
Recovery often plays a role in bad workouts and races. (Learn how to recover the right way and avoid the bad workouts).
When a workout goes wrong, look at the few days preceding it. Were you simply not recovered and ready for a hard effort? Again, this is where our being a slave to the training plan can hurt us. Your training plan should be a flowing schedule, where you're constantly moving things around to make sure the body's stress/rest cycle is obeyed. Be open to the possibility that what you think is enough recovery isn't. In those cases, spread the stress—allow another day or two of recovery after that type of workout.
Ebb and Flow
Accept that the body has an ebb and flow that we don't quite understand. Some days you just feel "off." As hard as it is to accept a bad workout or race when there are valid reasons, it's doubly challenging when there appears to be no reason at all. I used to worry about this, but now I just shrug it off as the quirkiness of the body and mind. Don't invest in it or overthink it. Move on.
If you have several bad workouts and races in a row, something's amiss. In these cases, you need to do a more thorough evaluation of your overall training plan and your life schedule. Usually, something's out of balance. I often see runners who are trying to do too much training (either in quantity or quality or both). Or they have too much going on in their lives outside of running and are too fatigued (mentally and physically) to have consistent training and racing.
If you're having repeated bad workouts or races, you may need to back off a bit and lower your expectations. Reduce your volume and intensity by 10 to 30 percent. Do this until your workouts and races improve, then gradually work back up to your normal training.race.