Check out example codes for "bounce script unity". It will help you in understanding the concepts better.

Code Example 1

void OnCollisionEnter(Collision collisionInfo){
  
  rigidbody.AddForce(Vector3.Reflect(direction, collisionInfo.contacts[0].normal) * mag, ForceMode.Impulse);

}

Learn ReactJs, React Native from akashmittal.com