Calculate the position difference between the transforms of target A and target B.
Transform targetA, targetB;
Vector3 posDifferenceFromAtoB = targetB.position - targetA.position;
By normalizing the posDifference you may get the direction vector from A to B.
If you are not familiar with Unity API, check here :
https://docs.unity3d.com/Manual/index.html
If you are not familiar with some essential mathmatics for (3D) game development, maybe you'd better study basic Linear Algebra first, like this one :
https://www.youtube.com/watch?v=fNk_zzaMoSs