It depends. If you left the company and your money is still in their 401k, you need to roll it over into an IRA. Then the money is yours to do with as you wish. If you’re still employed by the company, and the 401k is sponsored by them, then the French have a saying for your situation - “A so ell” (Say it slowly out loud with a French accent).
I can truly say that life is a learning experience. I am 53 now and I am learning everyday. The latest thing of course is also the oldest thing I learned. When playing a game learn all the rules, because when somebody changes them in mid-game you can challenge them about it.
Of course with the government, (Federal, State, Local), the rules change so fast that you never can keep up.
It reminds my of Ayn Rand's Atlas Shrugged. When there are so many laws against so many things, you will break at least one of them every day. It's easier to keep the populace under control that way.