You might be living under a rock if you haven't heard the word "recession" being thrown around in the media over the past few months. Thanks to inflation, the Federal Reserve's efforts to control inflation, and an overflow of global problems, a worldwide economic contraction is on the table (though not guaranteed) in the near future.

And it's exactly this situation that could make well-prepared investors significantly wealthier a few years down the line. So if you want to address your anxiety while setting your portfolio up for success, here are four simple actions you can take that'll pay off.

1. Determine when you'll need your money

The first step to prepare for a recession is to think about your financial goals and clarify them. Specifically, decide when you want to withdraw your investment. Will you need the money a year from now, when it's time to pay for a large expense? Or perhaps your time frame is five years -- or maybe even 30. 

The reason why this step is important is that you probably shouldn't be investing any of your moola if you're going to need it within three years. Any investment you make has a solid chance of taking at least that long to break even, which is a key consideration given that you're buying stocks in a recessionary environment where share prices are apt to fall in the near term.

And it'd be a pity if you were forced to liquidate your position at a loss simply because you didn't plan ahead and keep your assets in cash or an equivalent instrument. 

2. Identify your vulnerable stocks

The second thing to do if you're afraid of a recession is to look at your portfolio and assess which of your investments are more vulnerable and could face harsher headwinds in the event of a recession -- and which positions may be more stable.

For example, if you own shares of Johnson & Johnson (JNJ -1.15%), you would probably mark it as being relatively sturdy in a recession. The company develops medicines and medical devices that consumers need.  Economic conditions would have to be quite dire for people to start skimping on such necessary products.

In contrast, if you own some Tesla, (TSLA 4.96%) you'd do well to identify it as being very vulnerable to squeezed consumer wallets. Expensive electric vehicles might well be the products of the future, but they're not high on the list of household priorities to purchase when money is tight.

Likewise, the automaker is vulnerable to all manner of fluctuations in the prices of the commodities it needs to make its vehicles, which might be an additional headwind in a recession.

3. Start stashing cash to build on your high-conviction positions

Now, it's time to review your positions still further, including your investing thesis for each one, to decide whether their challenges are temporary and caused by macroeconomic factors beyond their control, or whether a recession might usher in conditions that would ultimately be fatal to their long-term returns.

Let's say you think Tesla could be vulnerable to falling sales during a recession. But you also think that it'll survive any headwinds and be able to keep growing at a steady pace afterward. You may then want to save up cash to buy more shares -- of course, as long as it's not too large a position and is a part of a diversified portfolio. You could also do the same thing for your less vulnerable stocks, like Johnson & Johnson.

4. Bide your time patiently

The last thing to do if you're worried about a recession is to set up your watch lists and portfolio alerts to let you know when it may be time to buy more shares of the stocks you're eyeing. Then, wait patiently, preferably while continuing to save cash and continuing to build on your high-conviction positions that you don't expect to be vulnerable, like Johnson & Johnson. It's probably for the best to pause your purchases of highly vulnerable companies like Tesla if you think a recession is coming, though.

That's right, you shouldn't stop buying stocks in general if you're fearful -- just prepare to buy more shares if the conditions make it lucrative to do so. In other words, it's best to make your plans for what to do with your portfolio during a recession, then get on with your life. Most years don't feature recessions, and many of the predictions about looming recessions tend to be wrong. Once you have a strategy, it should help prepare you for whatever may happen.