CNBC’s Jim Cramer on Wednesday advised investors to buy stock of companies that are adjusting their hiring efforts to fit the economic environment.”If you want to invest with profligate companies, be my guest. I want to invest in well-run companies … with very smart CEOs. That means buying the stocks of those companies that think twice about continuing to hire in this environment,” he said.The “Mad Money” host’s comments come after Google said in an email to employees that it will pause hiring for two weeks, according to The Information. Parent-company Alphabet said last week in a memo to employees that it plans to slow down the pace of hiring through next year, citing economic headwinds.Shares of Alphabet closed slightly up on Wednesday.”It is still ridiculous that anyone is freaking out over these stories, still. These stories about a hiring slowdown, as unfortunate as they are. … When you hear ‘Fed-mandated slowdown,’ that means less hiring and more layoffs,” he said.The Federal Reserve has increased interest rates this year to tamp down skyrocketing inflation, sparking fears about a looming recession. The Fed’s next meeting will take place later this month, and investors expect a 75- or 100-basis point rate hike after June’s red-hot inflation numbers.Cramer told investors that instead of nervously eying large companies and their hiring moves, they should focus on taking a long-term strategy for their portfolios.”Take long-term positions in what you like or simply buy a very good index fund in terms of the low cost, and hold it. That’s been the best form of investing and it’s one that historically handily beats inflation,” he said.Disclosure: Cramer’s Charitable Trust owns shares of Alphabet.