Boy is that a loaded question, and one not easily answered. You hit it right on the nail when you said painful emotions can shut down our rational thinking. That's when our behavior becomes poor and things get worse.
I am mentally and emotionally more healthy right now than I have in years. But I am not out of the woods. I can give you a few of my experiences. You may not like some, but perhaps you can glean something from what I share.
The biggest lesson I've learned is that if I don't turn to God with my sufferings and hurting emotions, it all snow balls. God helps me keep things in perspective. He gives me strength and guidance.
Another thing is taking responsibility to take care of myself, and to use the tools I have been given to cope with emotional stress, even if it is not from a mental illness. See my article on this http://lambservant.hubpages.com/hub/Taking-Part-in... Emotional pain is so intense it incapacitates us sometimes. We feel helpless and sometimes hopeless. The important thing is that if we see we are not handling it well, we need to seek help. It is my personal belief, that we should turn to God daily no matter what, but especially when we are suffering. But also, we need to be able to find some healthy, safe people to talk to and process our pain with, to receive support, guidance, fresh perspective, and sense of being loved and valued. Whether that is from a professional counselor, or a trusted friend.
Surround yourself with safe people, know whom you can trust, and allow those people to support you and love you.
The Bible says God does not allow us to bear more than we are able. I found that hard to believe on occasion. But once I started to turn to him, I found that He, and my special support people (whom he uses to help us) were indeed able to help me overcome.
Today I am doing so much better in my relationships, not going off the deep end when trials come, reminding myself of what I have already come through and how i got through it. There is hope. It is never easy, but with God's help and supportive friends and professionals, we can get through and overcome. Also see my hub https://hubpages.com/health/Helpful-Suggestions-to... Also, if you are dealing with painful memories of abuse see my hub on that http://lambservant.hubpages.com/hub/Restoration-Wh...