Setbacks of different kinds occur several times every year. The question, therefore, is not “How can I avoid it?” but “How can I get back on my feet as soon as possible?” Because you’ll start to lose your perspective along with time, the biggest concern should be to make it in the shortest time frame possible, without leaving it half-done.
Certain things take longer to recover from because of their intensity and importance, like the death of a loved one. These are the situations where you are at loss for words, and they take time. But some things cripple us in the end because we didn’t deal with them on time. That’s why knowledge of self is important. You gotta know your limitations. And you gotta know how to deal with them before they come to get you.