There's no denying it's an ugly situation out there for investors. The S&P 500 is down 25% year to date, reaching new 52-week lows just last week. Many popular individual stocks are down even further.

And yet, veteran investors know this is actually the time to hold their noses and dive in -- having faith that the market will turn around sooner or later, and probably sooner than later. As the old adage goes, expect it when you least expect it.

With that as the backdrop, here's a closer look at three all-weather stocks that would work for almost anyone's portfolio. If you have $1,000 available and not already needed to pay bills, build up an emergency fund, or pay down debt, you might want to put it toward buying shares in any of these three stocks.

1. Coca-Cola

It's not a name needing much of an introduction: Coca-Cola (KO -1.44%) is of course the owner of the global soft drink brand. Dasani water, Gold Peak tea, and Minute Maid juices (just to name a few beverage brands) are also part of the Coca-Cola family. After being in the business for 136 years, the company has clearly figured out how to turn potential consumers into loyal customers. That's why this year's and next year's top and bottom lines are expected to grow despite brewing economic turbulence.

This strength didn't prevent the stock from being swept up in recent marketwide bearishness. Coca-Cola shares gave up 15% of their value since August's high, mirroring the pullback of the S&P 500 to new 52-week lows just last week. Inflation, a weakening economy, and turbulence in China spooked current and would-be shareholders.

The thing is, those worries aren't really merited.

Sure, inflation is taking a bite out of Coca-Cola's bottom line. For perspective, its second-quarter cost of goods sold was up 28% year over year. But look at the rest of the quarter's key data: Worldwide volume sales were up 8% year over year, and revenue grew 12%. Those are indications that some of the company's higher costs are being passed along to consumers -- ultimately a sign of brand loyalty.

Perhaps the best argument for buying Coca-Cola shares now, however, is the dividend. With the stock's recent sell-off, the dividend yield for newcomers was elevated to 3.1%. By the way, that dividend has been raised every year for the past 60 years.

2. Visa

There was a time when credit card companies like Visa (V -0.49%) were highly sensitive to economic cycles. If discretionary spending softened, so too did the usage of credit cards.

That's not really the case anymore, though. Euromonitor International said global card-based payments eclipsed cash usage in 2016, and credit card usage has only continued to grow since then.

Credit cards are now regularly used as an alternative to cash or check-based payments for pretty much everything, including many of the basics we pay for regardless of the economic environment. And contrary to some assumptions, the rise of cryptocurrency and the option to make payments directly from a bank account aren't displacing cards the way cards displaced cash.

Credit card outfit Visa is fully plugged into this growth trend. For the quarter ending in June, Visa's revenue of nearly $7.3 billion was up 19% year over year despite the world making every effort to ease out of a pandemic that prompted lots of at-home shopping. The total number of transactions processed was up 16% from the previous year's tally for the same quarter, reaching 56.9 billion. Notably, that's 29% more transactions than in the comparable quarter of 2019, before COVID-19 rattled the world and arguably changed consumer behavior permanently.

The most exciting part? As much as credit card usage has grown, the 2021 Diary of Consumer Payment Choice from the Federal Reserve Bank of San Francisco indicates that 20% of payments made in the United States were still cash-based; another 11% use an automated clearing house (ACH). If such a breakdown were similar for the rest of the world, that would be a huge opportunity for continued growth for Visa.

3. TJX Companies

Finally, if you have an extra $1,000 you won't be needing anytime soon, add The TJX Companies (TJX -0.95%) to your list of stocks to buy.

It might be a tough prospect for some investors to get behind. TJX Companies' stores like TJ Maxx and Marshall's mostly sell apparel, and interest in apparel isn't snapping back to pre-pandemic norms (in fact, interest in clothing was waning even before COVID-19). Economic weakness will only further crimp that demand. There are some pockets of strength within the apparel arena, though. Those pockets include the value sliver of the market, where TJX Companies operates.

Anyone keeping close tabs on this particular retailer might still be missing the company's strength here. They see second-quarter same-store sales slipped 5% year over year, and overall revenue declined to the tune of 2%. But the second quarter of this year was being compared to a stellar second quarter of last year when the world was just starting to shop for more discretionary goods again. Last quarter's top line of a little more than $11.8 billion is still 20% higher than the pre-pandemic second quarter of 2019.

And there's good reason to expect more of this bigger-picture growth for the foreseeable future.

Major apparel retailers like Target and privately held JCPenney are holding too much inventory that must now be marked down (assuming it made it into stores in the first place). In some cases, inventory gluts are being handled by selling overstocked goods directly from distributors' and wholesalers' warehouses. In other cases, retailers and wholesalers are packing up unsold goods from their stores and selling them for pennies on the dollar, just to get them out of the way. Continued closures of conventional stores also free up merchandise for second-chance discounters, and analysts at UBS believe as many as another 50,000 U.S. storefronts will be shuttered by 2026. Some of that inventory will eventually make its way to TJX properties.

The opportunity isn't yet showing up on its books, but it is contributing to the stock's market-beating performance: TJX Companies could enjoy years' worth of low-cost inventory.