The Dow Jones Industrial Average (^DJI) may only contain 30 stocks, but it's still one of the most watched U.S. stock indices. The Dow is full of mature, profitable companies, which means it's a nice place to look for good deals when the stock market comes under pressure.

Two Dow stocks that look like bargains right now are 3M (MMM -1.05%) and International Business Machines (IBM 1.05%).

3M

Industrial giant 3M has disappointed investors over the past few years. The stock is down more than 50% from its pandemic-era peak, and it trades well below the low reached during the COVID-19-induced panic of early 2020.

To be fair, the iconic company is having some real issues. Demand for much of what the conglomerate sells is slumping amid a tough economic environment. Safety and industrial products suffered a 6% decline in organic sales in the first quarter, partly due to tumbling demand for disposable respirators and the company's exit from Russia. There was some strength in automotive products but not nearly enough to offset declines elsewhere.

In transportation and electronics, a whopping 35% decline for electronics drove an 11.3% organic sales decline overall. People are buying fewer smartphones, TVs, and other gadgets, and original equipment manufacturers (OEMs) are reducing inventories. Health Care was a bright spot with 1.4% organic sales growth, while the consumer segment saw sales drop 6.8%.

Despite these sales declines, 3M's profit margins are still impressive. While segment-operating margins were down, they ranged from 15% to 20.2% in Q1. Earnings slumped significantly year over year, but 3M has some plans in place to shore up the bottom line. A second round of layoffs will contribute to an annual operating-income improvement of between $700 million and $900 million, and the company is putting a greater focus on its best growth opportunities.

Investors willing to bet that this century-old company will find a way to make it through this downturn can do so at a bargain price. 3M expects to generate between $8.50 and $9.00 of adjusted earnings per share in 2023, putting the price-to-earnings (P/E) ratio at just 11. The company also pays a dividend yielding more than 6%, which will reward investors for sticking around for 3M's turnaround.

3M has been in the Dow for nearly 50 years. The beaten-down stock price makes it a compelling option for any long-term investor.

IBM

While the artificial intelligence boom is largely happening outside of Dow stocks, IBM has been working on AI for a very long time. It's 2011 Jeopardy! win with its Watson natural language system was a watershed moment, and the company is now using AI technology across its business.

On top of infusing AI into many of the products it sells to its clients, IBM is pausing hiring in areas where AI and automation could make a big impact. Thousands of jobs at IBM could eventually be replaced with AI, a big potential money saver for the tech giant.

IBM has struggled to grow revenue and earnings since its shift to cloud computing and AI began nearly a decade ago, but it's finally found its groove. The company expects to grow revenue by as much as 5% this year at constant currency while tacking on an additional $1 billion in free cash flow compared to last year; neither is a small feat in the current economic environment. IBM's embrace of AI for some jobs could help accelerate profit growth in the years ahead through lower costs.

With IBM expecting to generate free cash flow of $10.5 billion this year, the stock trades at a paltry price-to-free-cash-flow ratio of about 11. And like 3M, IBM pays a generous dividend. IBM's dividend is good for a yield that tops 5%, and the company has increased that dividend for 28 consecutive years.

IBM does a lot more than AI. Thanks in part to the acquisition of Red Hat, the company is a leading provider of hybrid cloud-computing software, hardware, and services. Big organizations with complex IT infrastructures turn to IBM to help guide them through their own digital transformations.

With pessimism holding down shares of IBM, now's a good time for investors to buy and hold this beaten-down Dow stock.