How i move an object and don't collide to another

Hello I’m kinda new to Unity so i need some help. I have 2 objects(lets call then A and B). Both of then will move if I drag,however if I move A, the object B can’t move position if i pass inside him.The same goes both way. I have the code to drag the object,but every time I pass the object A inside B the object B flies away. I cant find a way to fix this.If you can help,I’ll be very thankful.
Thank you!!

You can use Ignore Collision and use the bool field to activate/deactivate the Ignorance.