Check out example codes for "unity how to rotate something to point to something else". It will help you in understanding the concepts better.

Code Example 1

Vector3 dir = target.position - transform.position;
Quaternion lookRotation = Quaternion.LookRotation(dir);
Vector3 rotation = Quaternion.Lerp(partToRotate.rotation, lookRotation, Time.deltaTime * turnSpeed).eulerAngles;
partToRotate.rotation = Quaternion.Euler(0f, rotation.y, 0f);

Learn ReactJs, React Native from akashmittal.com