Lead bromide, PbBr2, is a simple ionic compound made of lead ions, Pb2+, and bromide ions, Br-. It is a binary compound, which means it contains just two elements. It only conducts when it is molten, so it is heated until it melts and then electrolysed using inert electrodes. Inert electrodes do not react, so they only carry the current.
The positive lead ions move to the cathode and the lead metal forms there. The negative bromide ions move to the anode and bromine forms there. Bromine is a toxic gas, so the experiment must be done in a fume cupboard.
The rule for any molten binary ionic compound is the same: the metal is produced at the cathode and the non-metal is produced at the anode. Molten sodium chloride gives sodium at the cathode and chlorine at the anode. A safer compound to use in school is anhydrous zinc chloride.