I think that it was Ghandi who said that.
That's
disputed. Seems like a variation of it was first used by a man named Nicholas Klein, giving an address at a trade union back in 1918.
Protip: if you read an unsourced inspirational quote on the internet and it's attributed to Albert Einstein, Winston Churchill, Marilyn Monroe, or Gandhi, then it's almost certainly misattributed.