I suspect stagflation isn't as certain as you expect, but you could buy commodities if you want to guard against inflation. If you bought right before the market drops of 1973-74, you still recovered in 1975-76. Same holds for the dot-com crash: hold for 3 years before, the you're still ahead even after 3 years of drops.
Stocks will likely do fine despite inflation, but you could also diversify to commodities (oil, gold, etc). Commodities never pay a dividend or produce other goods, which is why they don't seem that great compared to stocks. So I've dabbled with less than 1% of my portfolio, but never ramped it up more.
You might also take a look at TIPS, which are inflation-adjusted government bonds. Unfortunately, when everyone knows about a risk to climbing rates, TIPS are priced accordingly. You could also aim for short-term bonds: whenever rates climb, you don't wait that long before buying new bonds.