Some companies may indeed be hurt by a slowing economy and rising gasoline and labor prices, Jim Cramer admitted to his Mad Money viewers Wednesday. But when everyone is worried, that's the time to buy, not to sell.

As we head into the beginning of earnings season, fears abound as investors fret over whether the best earnings may already be behind us. But Cramer noted that investors were far too negative on the semiconductor stocks not too long ago, and that proved to be a great time to buy the group. Shares of Advanced Micro Devices (AMD) - Get Report soared 8.4% today, with Micron Technologies (MU) - Get Report adding 3.4% and Lam Research (LRCX) - Get Report gaining 3.9%, all on news that sales may once again be picking up for the sector.

It was a similar story when investors sold Home Depot (HD) - Get Report over economic worries, and fled Apple (AAPL) - Get Report at the first hint of slowing sales in China. Back in December, shares of Apple, an Action Alerts PLUS holding, traded at $150 a share. Today, they closed above $195.

Cramer said some companies do get hurt by rising gas and labor prices. But that doesn't mean it's time to sell everything. 

Will You Have Enough Money to Retire?

Want to learn about retirement planning from some of the nation's top experts? Join TheStreet's Robert "Mr. Retirement" Powell live in New York on April 6 for our Retirement Strategies Symposium. For a limited time, tickets are available for $99 for this full-day event. Check out the agenda, learn about the speakers and sign up here.

Are Tobacco Stocks Heating Up? 

After being lost in the wilderness for years, the tobacco stocks have once again caught fire, with shares of Altria (MO) - Get Report and Phillip Morris (PM) - Get Report up 27% and 33% from their recent lows. But does that make both companies a buy?

Cramer said while both companies sell the same products, just in different regions, they're taking a very different approach toward the future. Altria recently took a 45% stake in Cronos Group (CRON) - Get Report , a cannabis company, and a 35% stake in Juul, the leading maker of e-cigarettes. Phillip Morris, on the other hand, has placed its bet on its own vaping platform, iQOS.

But Cramer noted that Juul is already the market leader, and is expanding into Europe, making it unlikely that iQOS will gain much traction. He was also bullish on Altria's stake in Cronos, one of only a handful of large cannabis players. He said Altria is the better of the pair for those investors looking to add a tobacco stock to their portfolio.

Cramer and the AAP team are making the case for CVS Health (CVS) - Get Report over Walgreen's (WBA) - Get Report . Find out what they're telling their investment club members and get in on the conversation with a free trial subscription to Action Alerts Plus.

Shopping for Packaged Foods

A few months ago, the packaged foods stocks were a toxic commodity on Wall Street, Cramer told viewers. But today, at least a few names have seen remarkable comebacks.

Readers may recall that last year, the packaged foods makers were rocked by rising transportation and labor costs that were taking a bite of their already razor-thin margins. Stocks like Kraft Heinz (KHC) - Get Report imploded, falling from $48 to $35 a share in a single session, while Kellogg (K) - Get Report also racked up huge losses.

But two stocks, namely J.M. Smucker (SJM) - Get Report and General Mills (GIS) - Get Report , have soared in 2019, gaining 23% and 29% respectively. The reason? Cramer said these are two well-run companies with share prices that have fallen enough to give them stellar dividend yields. Investors are flocking to Smucker's 2.9% yield and General Mills' 3.9% yield, both of which are far better than U.S. Treasuries. Both companies also have superb growth and expanding gross margins, despite rising costs in some areas.

Of the two, Cramer gave the edge to General Mills, trading at 15 times earnings, saying the company deserves a higher multiple than Smucker at just 14 times earnings. He was bullish on owning either one.

Executive Decision: Dominion Energy

For his "Executive Decision" segment, Cramer again welcomed Tom Farrell, chairman, president and CEO of Dominion Energy (D) - Get Report , to the show. Shares of the Virginia-based utility are up 8% for the year and 16.3% over the past 12 months.

Farrell said the deal to acquire SCANA, the troubled South Carolina utility, closed in January and it won't be long before the company is rebranded as part of Dominion Energy. He was also bullish on the completion of the Atlantic Coast Pipeline project, a 600-mile pipeline to bring natural gas from West Virginia to the Virginia and North Carolina coasts, and which has been stalled over environmental concerns.

When asked about the environment, Farrell noted that two decades ago, Dominion generated 55% of its power from coal, but today, that number is just 12%. He said Dominion remains committed to the environment, as well as other social issues like diversity and equal pay.

Finally, when asked about his company's liquified natural gas export terminal, Farrell said the output from the terminal is now sold out for the next 20 years, as demand from Japan and India continues to outstrip supply.

Playing to Win: Dave & Buster's 

In his "No-Huddle Offense" segment, Cramer said the stock of Dave & Buster's Entertainment  (PLAY) - Get Report deserves a lot of credit for using every tool at their disposal to engineer a stellar quarter and an upside surprise that few saw coming.

In an environment where many consumers prefer to play video games on their couch and order food online, Dave & Buster's was able to lure customers by creating excitement and a compelling experience as well as growing its number of locations. The company also benefiting from streamlining its menu, aligning new items toward fresh, natural and organic, and optimizing its labor costs.

But the company didn't stop there. Dave & Buster's also rolled out a new mobile app and rewards program and has shifted more ad dollars toward efficient targeted digital sources. Cramer said the management at Dave & Buster's deserves a lot of credit for a job well done.

On Real Money, Cramer is talking more about what makes Dave & Buster's a winner. Get more of his insights with a free trial subscription to Real Money.

Lightning Round

In the Lightning Round, Cramer was bullish on Nokia (NOK) - Get Report , ON Semiconductor (ON) - Get Report , (CRM) - Get Report and Ventas (VTR) - Get Report .

Cramer was bearish on Albemarle (ALB) - Get Report , Brookdale Senior Living (BKD) - Get Report and Cree (CREE) - Get Report .

Search Jim Cramer's "Mad Money" trading recommendations using our exclusive "Mad Money" Stock Screener.

To watch replays of Cramer's video segments, visit the Mad Money page on CNBC.

To sign up for Jim Cramer's free Booyah! newsletter with all of his latest articles and videos please click here.

At the time of publication, Cramer's Action Alerts PLUS had a position in CVS, LRCX HD, APPL, CRM.