Solid lead bromide, PbBr2, does not conduct electricity, but when it is heated until it is molten its ions are free to move and it can be electrolysed. Inert electrodes are used, usually made of graphite, so that the electrodes themselves do not take part in the reaction. Because bromine is a toxic vapour, this experiment is done in a fume cupboard. A safer alternative for practical work is anhydrous zinc chloride.
Lead ions, Pb2+, are positive, so they move to the negative cathode and are discharged to form lead metal. Bromide ions, Br-, are negative, so they move to the positive anode and are discharged to form bromine, a non-metal. In general, when a molten ionic compound is electrolysed, the metal is produced at the cathode and the non-metal is produced at the anode.
You can use this pattern to predict products. A binary ionic compound contains two elements only. Molten potassium iodide gives potassium at the cathode and iodine at the anode. Molten magnesium chloride gives magnesium at the cathode and chlorine at the anode.