Check out example codes for "unity how to do collision detection with one object". It will help you in understanding the concepts better.

Code Example 1

void OnCollisionEnter(Collision collision)
  {
      if (collision.gameObject.tag == "theobjectToIgnore")
      {
          Physics.IgnoreCollision(theobjectToIgnore.collider, collider);
      }

Learn ReactJs, React Native from akashmittal.com