How do you know the charge of common ions, i.e. nitrate, sulfate, etc?
Normally, the charge of common ions have to be committed to memory.
Sulfates, carbonates, biphosphates, all have
All these charges simply have to be learned. There are not that many, and often you are given a clue.