If the person who left gave written notice or entered into a contract to obtain the electricity supply, her/his liability ends either when s/he informs the supplier s/he is leaving or with the passing of time (see here). Any remaining occupiers who originally gave notice in writing or entered into the contract are liable for the arrears along with the person who has left.
Where nobody gave notice or signed a contract, liability for the arrears depends on the facts of each case. You could still be held liable for all of the arrears, but may be able to negotiate a compromise with the supplier (look at the supplier’s code of practice on payment of bills and treatment of arrears, which may contain an indication of the supplier’s attitude or general approach).
As a joint occupier or sharer, you could ask for the amount of the arrears to be apportioned between the people responsible for the bill, particularly if the supplier knows the whereabouts of all the parties. Electricity suppliers are entitled to refuse to supply an occupier who owes arrears1Condition 22 SLC and, in any event, could pursue each debtor separately through the courts.2Laverty and Others v British Gas Trading  EWHC 2721 If the occupier who left was your partner, and you had little or no control over the income of the household (eg, only your partner had a wage, received state benefits or you were the victim of economic abuse),3s1(3) Domestic Abuse Act 2021 you could argue that you should not be held responsible for any arrears that accrued while your partner was present and ask the supplier to pursue your partner for the arrears.
If you were jointly supplied under the terms of a supply contract, the terms of the contract apply. There may be scope for you to argue that any arrears should be apportioned between all the parties to the contract. When the previous joint occupier leaves, make sure you inform the supplier of the meter reading and/or apply for a new contract/deemed contract in your own name so the arrears relating to the joint occupancy are clearly established.
Where a joint deemed contract comes to an end because one of the occupiers has left, inform the supplier and establish any arrears relating to the period of joint occupancy.
The strict application of this legal position on liability for a bill can create problems for many customers with children left with large arrears after a spouse/partner has left. Gas suppliers should, therefore, be urged to treat these situations sympathetically and positively, taking into account the individual circumstances of each case. They should also take into consideration the existence of formal or informal agreements between the parties concerned for responsibility for household expenses, including gas. Seek advice from Citizens Advice consumer service if you do not feel your gas supplier is acting reasonably.