Or Stonewall Jackson. Or President Andrew Jackson. Or Amos Tapley. Or any of the other attributions.
It’s not a quote. It’s a common aphorism. It seems to have come into vogue in the 1830’s, when it was also fashionable to talk about taking counsel of your imagination, your hopes, and various other qualities and virtues. Pretty much everybody said it, in other words, or they’d be contrarians and tell people to take counsel of their fears instead of doing reckless things.