Consider buying stock in companies that produce real products that everyone needs. Food, cleaning supplies, toilet paper, hygiene, etc. It's hard to go wrong doing that.
The value would only grow _if_ the inflationary environment is worse than expectations, and people sacrifice even more discretionary spending to buy consumer staples. if the inflationary environment isn't as bad as expectations, then these companies would be out-performed by other, higher growth, discretionary goods companies.
There's no such thing as a risk free investment.