While still employed with that company can I cash out, or do you have to leave the company?
You generally can't cash out a 401(k) while employed - some employers will allow you to do an "in-service rollover" to an external retirement account (that you could subsequently divest), but it's not common.
And it doesn't matter, because you shouldn't do it anyway.
When you cash out a deferred tax retirement plan like a 401(k) or a traditional IRA, you pay income tax on whatever was withdrawn. If you're under 59 1/2, you'll ALSO pay a 10% penalty. so depending on your federal and state tax brackets you may be paying up to 50% tax on your cashed out funds.
Also, the success of your company has absolutely no bearing on these retirement funds. They are not owned by the company - they are owned by YOU (with some broker as a custodian). If the company ceased to exist tomorrow, those funds would still be held by the broker in your name.
If you think the MARKET is going to crash, then you can choose safer investments, but be aware that over 10+ years the market has always recovered from crashes. If you plan is to get out, wait for it to go down, and get back in, that means that you know 1) when the peak is hit to get out and 2) when the bottom is hit to get back in. Many people think they know on an impending crash, but are wrong. I've been reading questions on this site for 2 years saying "I know the market is going to crash soon" but it has kept going up. Even during a pandemic, the market is back at all-time highs. Those that got out in March missed out on 30-50% gains.