When rolling over a 401(k), you may be able to take a portion of your money out of your plan at work and leave the rest in, but not all plans allow this.
If you are required to take all of your money out of the plan, you can roll over to an IRA with Wahed Invest, then take the portion that you need out of the IRA. Depending on what you need the money for, you may qualify for a waiver of the penalty tax if you take the money from an IRA rather than directly from your plan at work.
If you have access to other money, you may want to avoid taking money out of the plan. Even a small withdrawal can have a drastic effect on the growth of your retirement savings.