Well, it’s a famous quote attributed to a lot of different people such as Skinner or Einstein. But who said it first? Luckily there are the people behind quoteinvestigator.com to investigate. Do read the whole quest as it’s a relevant example of how attribution sometimes happen, but this is their conclusion:
In conclusion, based on current knowledge this family of sayings has an anonymous origin. The December 1907 citation pointing to a “college president” was intriguing and perhaps a likely candidate will emerge in the future. The other citation in December 1907 pointing to Ralph Waldo Emerson was interesting, but the connection remains unsupported. Albert Einstein, B. F. Skinner, Agnes F. Perkins, E. F. L. Wood, James Bryant Conant and others have used expressions in this family but none of them claimed authorship.
In the meantime: