How are nuclei stable?
Since the gravitational force between two protons is negligible there must be another force holding the nucleus together. This is the strong nuclear force, which as the name suggests is extremely strong but it is also extremely short range and so it's effects are only felt on the scale of nuclei and baryons. As you can see in the graph, if two protons approach each other they repel each other due to electrostatic repulsion but once they get within about $\mathrm{3~fm}$ of each other the strong nuclear force begins to become significant and at about $\mathrm{2~fm}$ it starts to outweigh the electrostatic repulsion and bind the two protons together.

It is also interesting to note that at even shorter ranges the strong nuclear force is repulsive and so there is an equilibrium position, indicated on the graph, where the strong nuclear attraction and the electrostatic repulsion are equal in magnitude and so the net force on the protons is zero.

Note that the graph shown is for two protons and so in nuclei containing more than two protons the numbers will be different but the principle is the same.