Gandhi I believe said this.
One day a mother went to Gandhi and said her child eats too much sugar, how can I make him stop? Gandhi told the mother to come back in two weeks and he will tell her. Confused, the mother went away and then came back two weeks later. "Why did you send me away for two weeks?", the mother asked. Gandhi replied, "I needed to stop eating too much sugar myself first before I could give you any advice."