Niccolò Machiavelli said this quote

But confining myself more to the particular, I say that a prince may be seen happy to-day and ruined to-morrow without having shown any change of disposition or character. This, I believe, arises firstly from causes that have already been discussed at length, namely, that the prince who relies entirely upon fortune is lost when it changes. I believe also that he will be successful who directs his actions according to the spirit of the times, and that he whose actions do not accord with the times will not be successful. Because men are seen, in affairs that lead to the end which every man has before him, namely, glory and riches, to get there by various methods; one with caution, another with haste; one by force, another by skill; one by patience, another by its opposite; and each one succeeds in reaching the goal by a different method. One can also see of two cautious men the one attain his end, the other fail; and similarly, two men by different observances are equally successful, the one being cautious, the other impetuous; all this arises from nothing else than whether or not they conform in their methods to the spirit of the times. This follows from what I have said, that two men working differently bring about the same effect, and of two working similarly, one attains his object and the other does not.