How to get another script on the same GameObject

I have a prefab which is my enemy, this prefab contains a script that controls when the enemy moves and another that creates the path for it to move along. (A* path finding) I need to reference the second script to tell it to create a path for the enemy.
The problem I’m having is making the first script reference the script that is attached to that Game Object

I need something that will allow me to create a variable that references the second script on the game object that I can then use to change the value of a variable there

Thanks

You can create a reference of your other script type. Like this :

public class Controller : Monobehaviour
{
	public PathController pathController;
}

and reference it manually in the inspector, or find it on Awake

private void Awake ()
{
	pathController = GetComponent<PathController>();
}