When colliding 2 moving object then they should stop moving

I made a platform on which I placed 2 sqare object, I applied rigid body on both the object, so when I move first object and collide with other object, it drags the other object with it as well. Then I applied rigid body only on first object , it didn’t drag the second object but when move the second object tried to collide with first object it went through the first object… what I want is when any moving object collide with each other it stop there, there sould be no movement at all…what shoud i do?? Pls help

You should make sure both objects have a Collider and at least one of the objects have a Rigidbody attached to them