I don't think there's a good indicator for predicting it ahead of time. If you are worried you could switch from tech stocks to something more conservative.
You can sometimes tell when the collapse has started from the headlines though - stuff like top stocks down 30%, layoffs announced. Which may sound too late but with the dotcoms things kept going down for another couple of years after that.
There is a liquid market of TQQQ puts.