Be aware that:
1) we're likely in a declining/sideways market for at least another year until inflation subsides, possibly longer
2) the Fed has most of the control over the inflation/deflation levers (on demand side)
3) markets will most likely recover over the long term, historically speaking
The Fed is purposefully reducing their asset holdings and increasing interest rates to slow down demand, which in theory should cool inflation. Once the economy cools enough, they will "flip the switch" back on to supporting markets by reducing interest rates, at which point #3 should begin. Educate yourself on the Fed and their impact on markets.
So if you sell at the lows, you're accepting the losses, can move on and invest again later. If you can afford to hold through this bear market, you may recover some of your losses on a longer timeframe. You can also position your portfolio with some downside protection (e.g long dated put options on indexes, selling covered calls on your stocks etc) to reduce the pain, you don't have to just watch your portfolio decline.