The law of conservation of momentum tells us that the momentum of a system of particles is always constant or conserved if no interfering external forces are introduced in the system. The impulse-momentum theorem is required to understand the law of conservation of momentum.

The law of conservation of momentum is the special case of impulse-momentum theorem, which is the force is zero. Let's illustrate this with an example. The impulse-momentum theorem is $$J = p_2 - p_1$$ if $$p_1$$ is the final momentum and $$p_1$$ is the initial momentum under the action let's say constant force $$F$$. If the force is zero, $$J = 0$$ which implies $$p_2 = p_1$$, it means the initial momentum is equal to the final momentum and the momentum is said to be conserved.
The collision of two bodies $$A$$ and $$B$$ in straight line motion is shown in Figure 1. According to the Newton's third law the force body $$A$$ exerts on body $$B$$ must be equal and opposite to the force the body $$B$$ exerts on body $$A$$ that is, $${{\vec{F}}_{A\text{ on }B}}=-{{\vec{F}}_{B\text{ on }A}}$$.
So, ${{\vec{F}}_{A\text{ on }B}}+{{\vec{F}}_{B\text{ on }A}}=0 \tag{1} \label{1}$
The force $${{\vec{F}}_{A\text{ on }B}}$$ in terms of the rate of change of linear momentum is $${{\vec{F}}_{A\text{ on }B}}=d\vec p_1/dt$$ and similarly $${{\vec{F}}_{B\text{ on }A}}=d\vec p_2/dt$$. The Equation \eqref{1} becomes, \begin{align*} \frac{{d{{\vec p }_1}}}{{dt}} + \frac{{d{{\vec p }_2}}}{{dt}} &= 0\\ {\rm{or,}}\quad \frac{{d{{\vec p }_1} + d{{\vec p }_2}}}{{dt}} &= 0\\ {\rm{or,}}\quad \frac{{d\vec P }}{{dt}} &= 0 \tag{2} \label{2} \end{align*}
In Equation \eqref{2} the sum of the total linear momentum is $$d\vec P = d{\vec p _1} + d{\vec p _2}$$ which is constant. Note in Equation \eqref{2} that the derivative of a constant is zero and hence the total momentum of a system of particles is constant or conserved if no net external force acts on the system which we call the conservation of linear momentum. We can conclude from the conservation of linear momentum that the total momentum before collision is equal to the total momentum after collision.