There’s a way of thinking about stocks that can help you avoid that fate. It’s a mental trick that makes it easier to stomach those terrifying days when your 401(k) plunges. And it has roots in the math of what you’re buying when you invest in the stock market.

When you buy a share of stock, you are buying a claim on an infinitesimal portion of the profits of that company for the rest of time. When you buy a broad index mutual fund or E.T.F., you are essentially buying a share of the future profits of all major corporations.

The way those profits will be delivered to your pocket will vary. Some of it will be paid directly to you in the form of a dividend. Some will be held by the company or used to buy back shares, which materializes in the form of a higher stock price. And some will be reinvested by the company’s managers to drive growth.

We may not know exactly how much money big companies will be making in a decade or two, or what technologies and business strategies they will use to make it, or which companies will account for more or less of that total than they do now. We don’t know how severe a potential coronavirus outbreak this year will be, or how long it will last, or how it will affect the near-term performance of corporate America.

But if you look over the sweep of history, one lesson is clear: Earnings tend to rise over time, as the world economy grows. However, the price an investor has to pay to get a slice of those earnings can swing wildly, much more so than any plausible forecast of that long-term future does. And rarely has that been more true than in the last three weeks.