What does it mean?
Every failed attempt teaches you something, so it isn't really a failure. It brings you closer to the way that does work.
Who said it?
Thomas Edison: American inventor (1847–1931).
These exact words are widely credited to Thomas Edison, but they don’t appear in their known work. They may be a later paraphrase or a misattribution.