Charlotte Brontë said this quote

Happiness is the cure—a cheerful mind the preventive: cultivate both.