Scientists say healthy habits help build "psychological flexibility".