The science of resilience is a new field in psychology, and research is yielding useful guidance for recovering from adversity--including injuries and chronic pain:
http://time.com/4306492/boost-emotional-resilience/