Niccolò Machiavelli said this quote

... I believe that he will prosper most whose mode of acting best adapts itself to the character of the times; and conversely that he will be unprosperous, with whose mode of acting the times do not accord.