For every collision you can write out a conservation of momentum equation (i.e., set the momentum before the collision equal to the momentum afterwards).
m1v1i + m2v2i = m1v1f + m2v2f
In one dimension, the fact that momentum is a vector can be dealt with by using appropriate signs for the velocities. In other words, choose a positive direction.
Let's say we know everything about the colliding objects before the collision, and we want to use our equation to predict what the objects will do after the collision.
In an elastic collision kinetic energy is conserved, so you can write out an equation setting the kinetic energy before the collision equal to the kinetic energy afterwards. Combine this with your momentum equation to solve for the two final velocities.
In a completely inelastic collision there is only one final velocity, because the objects move together. If there is just one unknown you can use your one momentum equation to solve.
An inelastic collision is harder to deal with because there are two unknowns in the momentum equation and you can't bring in energy because energy is not conserved. In this case we would need to have some other way to solve for one of the unknowns.