To get the position of a gameobject in the world, you can retrieve a Vector3 (x,y,z) of it's Position from the Transform component that's added by default to every gameobject, as seen in the inspector:
gameObject.Transform.position returns the absolute world position.
Note that this is the same as
GetComponent<Transform>().position on your gameobject.
gameObject.Transform.localPosition returns the position relative to that gameobject parent's position - if your gameobject has a parent whose position is not 0,0,0 this will return the Vector3 value of what you see in the inspector, rather than the absolute world position.
If you're not sure how to reference the two gameobjects in your script, the simplest and most basic way is to create two GameObject variables in your script and expose them in the editor (since they are serializable):
public GameObject OriginPosition;
[SerializeField] private GameObject _destinationPosition;
Above: Two ways of exposing a variable to the Unity Inspector
Above: The result, now you can simply drag and drop GameObjects into these slots.