You are going to pay those taxes anyway when you retire. 401k is only beneficial if you expect to pay lower tax rate when you finally retire. Unless you expect the federal tax rates to go significantly down across the board, withdrawing from 401k when you have no other income is actually a great idea, or it would be without the 10% penalty.
However, you typically can borrow money from your 401k, and pay no penalty, which makes it a good option if you need temporary liquidity.
And considering how early this pandemic hit in the year, if you were laid off in March you didn't even make 25% of your salary yet. That means your taxes are likely to be quite low for the year, so this is actually a good time to withdraw money from a 401k and take the tax hit.
If I ever have a full year gap between jobs (like some kind of a long sabbatical), I'm going to be doing a lot of Traditional to Roth converting, for exactly this reason.
However, you typically can borrow money from your 401k, and pay no penalty, which makes it a good option if you need temporary liquidity.