The risk of opting out is that terms and conditions change to the detriment and you either can't get back in or you get in with worse T&Cs.
Also due to tax relief, you also don't save all your contribution, as it's taken before tax.
If you can pause contributions or reduce them to a very token amount, that might not be so bad, especially if you keep your employer's contribution. You could always catch up later.
Also ask if there's any hardship funds available, or could you get a second job, babysitting or a couple of shifts in a bar/restaurant in the evenings/weekends?
Another consideration would be that you've been contributing for a long time. 40 years is often a 'full' pension, yet by the time you reach state pension age, you'll have been contributing for 47/48 years, so your pension will be higher than standard anyway.
However, opting out of your pension is a very last resort, so have you honestly done everything you could do about your debts?
A debt management plan might be more appropriate and you'd be allowed to continue making pension contributions. Have a look at:
https://www.moneysavingexpert.com/loans/debt-help-plan/