This quote is from his 1994 lecture. It's available on YouTube if you search "Peter Lynch 1994 Lecture". I can't post the link here since this sub doesn't seem to allow YouTube links. The sentence in the title is at around 15:50 in the video posted by GiraffeValue.
The video is quite long and the image quality isn't good due to the age, but I think lots of his advice are timeless and would be helpful for investors seasoned and new. I highly recommend going through the whole lecture since it's very informative and quite funny.
His words leading up to this quote:
First they tried to predict the stock market. This is a total waste of time. No one can predict the stock market. Then they tried to predict interest rate. If anybody can predict interest rate right 3 times in a row, they would be a billionaire, and there ain't lots of billionaire on the planet. No one can predict the economy. In 1982 we have 20% prime rate with double-digit inflation and double-digit unemployment. I don't remember anybody telling me in 1981 about it. I read and study a lot and I don't remember anybody telling me we're gonna have the worst recession since depression. What I'm trying to tell you is that it would be very useful to know what the stock market are gonna do. It'd be terrific to know the Dow Jones' average a year from now would be X, that we're gonna have a full-scale recession and the interest rate gonna be 12%. That's useful stuff. You'd never know it though. You just don't get to learn it.
Philip Fisher, another very successful investor and the author of some great investing books also held similar belief:
Postponing an attractive purchase because of fear of what the general market might do will, over the years, prove very costly. This is because the investor is ignoring a powerful influence about which he has positive knowledge through fear about a less powerful force about which, in the present state of human knowledge, he and everyone else is largely guessing. (Common Stocks and Uncommon Profits, Ch.6)
My 2 cents:
We've been seeing lots of posts saying "Don't fight the feds." or "The economy's gonna be a lot worse." recently. These people could be right this time, but if they have the ability to consistently predict the market, they would be making millions and enjoying their life, not posting on reddit. Even the Feds themselves failed to predict the economy considering how many time they revised their plan for the past year. The best course of action would be keeping DCA into index funds if you're a boglehead and keep buying stocks of companies you believed in at reasonable valuation if you're a stock picker.
For stock pickers, Philip Fisher also wrote about his criteria of a resilient business:
The product or service provided by the company is recognized by the customer as being very important for the proper conduct of their activities.
Inferior or malfunctioning product/ service would cause serious problems for the customer.