You don’t withdraw from your retirement accounts to pay off debts, you take out a 401k loan and pay yourself back.
It’s definitely important to make sure you’ve fixed the bad habits that put you in that situation but I highly encourage people with high APR% debt that have healthy 401k balances to look into a 401k…