If you’re in credit, your old supplier will transfer the credit directly to your bank account once you’ve received your final bill.
If you’re in debit, you need to clear it as soon as possible, otherwise they might object to your transfer (which can cause severe delays to your move). If you’re having trouble paying, you can ask for a payment plan, which will still allow you to switch.