Effect of contributing to qualified retirement accounts with HELOC funds

If it is paid with post tax dollars (or untaxed dollars) how will you receive a tax benefit? Won’t it be a Roth 401k/IRA, in that if any tax is owed (probably not) it is already taxed?

I don’t see how it would be added back as income since it is not income. Also don’t see how you would get a deduction.