I broadly agree, and has the previous poster indicated, how the money should be invested depends significantly on when the money is likely to be needed to cover living expenses. I personally think that the reason to hold cash or short-term bonds is to protect against capital loss, which will become permanent if that money needs to be spent before valuations can recover. The reasons to hold stocks and shares or in some scenarios longer-term bonds are: to achieve a higher nominal return, to protect against inflation, and to hopefully achieve some real growth after taxes and inflation in the value of the pot.
For my own investments, I tend to follow those views by keeping money that needs to be spent within 1-3 years in cash or short term bonds, keeping money (such as pension pots) that will only be spent in 7-10+ years or more mostly invested in higher-return but riskier assets such as stocks, longer-term bonds or property, and money that will get spent somewhere between year 3 and year 7 in a mixed portfolio that includes at least some short-term bonds or cash, some medium term and/or longer term bonds if interest rates are high enough to warrant that, and maybe a small amount of equities, in order to be exposed to a balance between inflation risk and capital loss risk.
Then, while there is no good way to know what the market will do next, we do always know what it just did, and for bonds in particular, we also know the return that will be earned if a specific bond is held to maturity (yield to maturity). So it is possible to take a view on valuation without that constituting market timing. For example, I held no long-term bonds at all during the period from 2009-2022 because interest rates were so low that I had zero chance to make any money while I would have carried a risk of losing money if interest rates went up. From today, it is still possible to lose money if interest rates go up further, but it is also possible to make at least some money if rates go down, stay flat, or go up slightly, so there is a reasonable argument for holding some long-term bonds today if they fit an investor's specific circumstances.