I am having trouble assigning public gameObjects

I am Attempting to create a chain of points, that spawn in and out as the player moves about, so i cant just assign the public gameObjects directly. (I am making the points lights so i can see them better) but the points are tracking the distance of the “PLayerWithTrail”(the player) from the point. I am stuck and dont know how to assign “Target” to the movable player.
this is the code that tracts the distance between two objects and i have the Origin (point) as a transform position and i need “Target” to be the player so i can destroy the point after it goes so far away.

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Distance : MonoBehaviour {
public GameObject Origin;
public GameObject Target;

void Start ()
{       
    Origin = gameObject;
   Target = //here is where i am lost         
}

// Update is called once per frame
void Update () {
   
    distanceBetween = Vector3.Distance(Origin.transform.position, Target.transform.position);
    if (distanceBetween > 8)
    {
        // Target.AddComponent<Light>().enabled = false;
        Object.Destroy(gameObject);            
    }        
}

}
`
and I have a separate code that spawns in the points in case it is useful:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PointInfo : MonoBehaviour
{
    public Transform cubeyMcCuberstien;
    public float c;
    private float addidive = 5;
    private float countDuccu;
    private GameObject dotterDottyFace;
    private float curX, curY, curZ, detox;
    int num, death;  
    
	void Start ()
    {
        countDuccu = 5;
        c = countDuccu + addidive;
        death = num - 20;
    }
	
	void Update ()
    {
        curX = GetComponent<Transform>().position.x;
        curY = GetComponent<Transform>().position.y;
        curZ = GetComponent<Transform>().position.z;
            
	    if (c <= GetComponent<Movement2>().moveCounter)
        {         
            dotterDottyFace = new GameObject("point"+num+"");
            //Components here
            dotterDottyFace.AddComponent<Distance>();        
           // dotterDottyFace.transform.parent = gameObject.transform;
            dotterDottyFace.transform.position = new Vector3 (curX, curY, curZ);
            dotterDottyFace.AddComponent<Light>();
            //dotterDottyFace.AddComponent<Distance>();
            //dotterDottyFace.AddComponent<DeathByTime>();
            c = GetComponent<Movement2>().moveCounter + addidive;
            num++;
            detox =death + 1 ;
        }
    }
}
Some of the things in this code are unnecessary but i just am trying to get a concept of what im doing before I go am optimize . if you have any suggestions as to how i can assign Target to PLayerWithTrail it would be greatly appreciated .

I am not sure why that first code got written like that here it is again:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Distance : MonoBehaviour {

    public GameObject Origin;
    public GameObject Target;

	void Start ()
    {   
        Origin = gameObject;
       Target = //here is where i am confused        
	}

	void Update () {
       
        distanceBetween = Vector3.Distance(Origin.transform.position, Target.transform.position);
        if (distanceBetween > 8)
        {
            // Target.AddComponent<Light>().enabled = false;
            Object.Destroy(gameObject);            
        }        
	}
}

Unless you are assigning it (drag and drop) in the inspector, you are going to have to give it a target from elsewhere in your program, the game manager or the target object.

using

target = GameObject.Find("Player");

will get you the player gameobject (if it is called “Player”). You are spawning and destroying the ‘points’ as you call them. I take it they are prefab then?
you can also use:

public gameObject target;

and on the prefab drag 'n drop the player into that slot in the inspector. If you don’t know how to do that: you can see it in this vid @ 3:33:

futhermore you can use FindWithTag or even FindGameObjectsWithTag if you want to get an array of multiple objects.
see the links for more info: