Factors that lead to from mental illness to flourishing?

What are the factors that lead to from mental illness to flourishing?