It's not about knowing when because, as you say, it's difficult to predict... Still preparing or defending your assets for the possibility would be wise.
Of course, if you do that you'll lose out on more from missed opportunities than you save from missed crashes. Soneone who did that in 2008 would be perfectly safe right now. They'd have missed out on quadrupling their money. But they'd be perfectly prepared.
So you can do as suits you. But the best strategy is to have a mix of bonds and stock. Never more than 70% bonds (as risk goes UP past roughly that point). The more you are able to deal with big movements (up or down), the more stock.
This is what Warren Buffet and others have endorsed for normal every day humans like us. The mathematics backs it up.