Let's see what happens in a Daniel cell (Zn/Cu). In the beginning, a Zinc atom looses 2 electrons and becomes a zinc ion $\ce{Zn^{2+}}$. The electrons are attracted by the copper ions $\ce{Cu^{2+}}$ in the other compartment. And the $\ce{Zn^{2+}}$ enters the solution. But look ! After some time there will be 2, 3 or more $\ce{Zn^{2+}}$ ions in this solution. This creates a electrostatic positive charge which is diluted in the whole solution around the Zinc electrode. This positive charge repells new positive charges that could be produced on the Zinc plate. So the creation of electrons at this electrode stops after some microsecond.
The same thing happens on the Copper electrode. On this electrode the electrons coming from the zinc electrode through the outer connection react with copper ions $\ce{Cu^{2+}}$ and this produces a metallic copper deposit on this electrode. But this will not last long, because if the electrons destroy positive ions, they are progressively disappearing. As a consequence negative ions (probably $\ce{SO_4^{2-}}$) become more and more numerous. After some time, the solution gets negatively charged and will prevent new electrons from arriving to the copper electrode.
So after a short while, the cell stops working. If you want it to continue working, you must find a way of getting rid of the sulfate ion around the copper plate, and to send them to the zinc compartment. That is the goal of the salt bridge. The excess of $\ce{SO_4^{2-}}$ ions around the copper plate are attracted by the excess $\ce{Zn^{2+}}$ ions from the anode. They move to them through the salt bridge. And the cell can continue working.