Generally people will tell you not to do that. But i think some of that is it’s a bad ha it to treat your 401k like a piggy bank.
The financial impact is more about whether it is a Roth or a normal 401k.
If it’s a Roth, you should be able to take the money out tax free.
If it’s a normal 401k, you will get hit fairly hard for taking money out.
1) you will pay a 10% penalty on the money you take out
2) it will also be taxed as normal income
Depending on your tax bracket, this could easily be 30+% of what you take out going straight to Uncle Sam.