With elastic collisions, energy is also conserved. The only really good examples of elastic collisions involve atomic particles and the like. But you can get pretty close in ordinary life, say with pool balls or a superball.
Lets say we start with two balls with masses and having initial velocities and respectively. They collide and end up with velocities and
Equating the total momentum and energy before and after the collision
Let's try to analyze the collision of two balls in one dimension.