How can I write the formula for potassium bromide?
You need to know the ions for potassium and bromide. Potassium is in Group 1 of the Periodic table so it loses one electron to become K+ and the Bromine atom is in Group 17 so it gains one electron to become Br-. The charges are therefore +1 and -1 and they balance and cancel each other out so the compound Potassium Bromide is one potassium ion (K+) and one bromide ion (Br-). The charges cancel out so are not shown. The chemical formula is written as KBr.