This is easier said than done, because we never know when a particular project will become inactive. In the past, I had come across a few projects which suddenly became inactive, after a lot of hype and market activity. It is very difficult to differentiate such projects from the genuine ones. Personally I have invested in a few such projects and lost my money. One example that I could give is that of the TMT (Traxia Membership Token). That project was faring really well.. until one day it suddenly crashed at the market.
I am not surprised, I am a big bag holder of altcoins and I believe that not all of them will succeed in this bear market, I never plan or hope for them to all succeed, but one or two good projects will make up for the projects that failed, it's not wise to ignore diversification when going for altcoins, they are too risky.