That depends on your specific situation and the type of energy contract you currently have.
If you have a fixed-term contract and the end date is not approaching yet, it's usually best to take your energy contract with you to your new address. This means simply updating your address within the existing contract. If you still want to switch providers, you may have to pay a cancellation fee and could lose any discounts you were entitled to. You can always request the exact amount of the fee from your supplier — they are legally required to inform you.
If you currently have an open-ended contract, such as a variable or dynamic contract, you can either transfer it to your new address or switch to a new contract free of charge. These contracts can be cancelled at any time.
You can usually manage your move easily through your supplier’s online portal or app. Make sure to notify them in advance.