Anyone know how to assign a variable from another gameobject with a prefab?

The enemy prefab I have doesn’t recognize the the FIndGameObjectWithTag

Heres an example: MyGameObject = GameObject.FindGameObjectWithTag(“Inset tag here”).GetComponent

I figured it out, I used FindObjectOfType