I am confused on if I should use Getcomponent or GameObject.Find with tag in my project

So the gist of what im trying to do is like a puzzle game that when Two circles are put in a pattern they get destroyed and other circles take their place. I need to get the initial Position of the circle in that instance while instantiating from that data and I don’t know what to do anymore :frowning: I am still a newbie and really just finding tutorials and putting it piece by piece

Here is the script for the circle
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ClickSine : MonoBehaviour
{
public static bool DivisionSine = false;
public static bool DivisionCosine = false;
public static bool Division1Sine = false;
public static bool Division1Cosine = false;
public static bool MultiplicationSine = false;
public static bool MultiplicationCosine = false;
public static bool Multiplication1Sine = false;
public static bool Multiplication1Cosine = false;
[SerializeField]

private Vector2 initialPosition;

private Vector2 mousePosition;

private float deltaX, deltaY;

public static bool locked;

void Start()
{
    initialPosition = transform.position;
  
    
}
private void OnMouseDown()
{
    if (!locked)
    {

        deltaX = Camera.main.ScreenToWorldPoint(Input.mousePosition).x - transform.position.x;
        deltaY = Camera.main.ScreenToWorldPoint(Input.mousePosition).y - transform.position.y;
    }
}

private void OnMouseDrag()
{
    if (!locked)
    {
        mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        transform.position = new Vector2(mousePosition.x - deltaX, mousePosition.y - deltaY);
    }
}
private void OnMouseUp()
{
    if (Mathf.Abs(transform.position.x- - 2.010169f) <= 0.5f &&
Mathf.Abs(transform.position.y- - 0.01999999f) <= 0.5f)
    {
        transform.position = new Vector2(-2.010169f, -0.01999999f);
        Multiplication1Sine = true;
    }

    else

    if (Mathf.Abs(transform.position.x - + 2.04f) <= 0.5f &&
Mathf.Abs(transform.position.y - + 0f) <= 0.5f) 
    {
        transform.position = new Vector2(2.04f, 0f);
        Multiplication1Sine = true;
    }

    else
    if (Mathf.Abs(transform.position.x- -0.04016852f) <= 0.5f &&
      Mathf.Abs(transform.position.y - 1.910782f) <= 0.5f)
    {
        transform.position = new Vector2(-0.04016852f, 1.910782f);
        DivisionSine = true;
        gameObject.tag = "SineInDivision";
    }
    else
        if (Mathf.Abs(transform.position.x -0f) <= 0.5f &&
  Mathf.Abs(transform.position.y- -2.17f) <= 0.5f)
    {
        transform.position = new Vector2(-0f, -2.17f);
        Division1Sine = true;
    }
    else
    {
        transform.position = new Vector2(initialPosition.x, initialPosition.y);

        MultiplicationSine = false;
        Multiplication1Sine = false;
        Division1Sine = false;
        DivisionSine = false;
        gameObject.tag = "Untagged";
    }

    
        
} 

}

and here is the script of the
game controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameControl : MonoBehaviour
{
private Transform Sinelocation;
private Transform Cosinelocation;
public GameObject tangent;
public GameObject Sine;
public GameObject Animation;
public GameObject cosine;

    [SerializeField]
private GameObject winText;
// Start is called before the first frame update
void Start()
{
    winText.SetActive(false);
    
        

}

// Update is called once per frame
void Update()
{

    {
        if (ClickSine.DivisionSine && ClickCosine.Division1Cosine)
          
        Sinelocation = GameObject.FindWithTag("SineInDivision").transform;
        Cosinelocation = GameObject.FindWithTag("CosineInDivision1").transform;

        Instantiate(tangent, Sinelocation.position, Sinelocation.rotation);
        
        Instantiate(Animation);

      
    }
}

}

Your question isn’t clear and your code doesn’t help clarify it for me but here is some info that might help you

GameObject.GetComponenet()
This is a costly method that can be called on game object to return an instance of a MonoBehaviour of that given type … for example if you had a reference to a game object which you knew to contain your ClickSine script then you could call this to get the value

GameObject.Find
and its variants are costly methods that can find a specific GameObject assuming it is currently ‘alive’ in your game … so for example if you knew one or more GameObjects with a given name or tag did exist at that time you could find them and return a reference to them using this method.

In general I would advise against using either method. With a good design you can generally avoid using them at all and they are inefficient/costly to use. I cant advise on what changes to your structure would let you avoid their use, as noted your question and code isn’t clear to me but have a think about what data you need to perform what actions and see what you can do to provide that data from known sources as opposed to doing lookups for it such as Find or GetComponent. e.g. add references to your required behaviours on your scripts i.e. public ClickSine myClickSine or when spawning put them in a collection so you can at least search fewer things and in a more controlled way.