recessions are an inevitable component of a business cycle. I can't predict when it will happen, but I can prepare for it to arrive when it surely will.
Preparing your investment portfolio for a recession means moving your money into lower risk, lower return investments. Trying to prepare for that is trying to time the market, which you can’t do. For retirement specifically, as long as retirement is sufficiently far away for you, then you’ll make the most money by forgetting that recessions even exist, and maximising for long term returns. Go look at pretty much any high growth mutual fund, even if it had a 30% down year in 2008, it’s 20 year returns will almost certainly exceed the returns of any low risk asset.