How do you get a function from an instantiated object with script from an object in the heirarchy.

hello, I have a serious promblem right now. I have this 2D infinite runner game that instantiates the player when the game starts. Im making a function where when the player hits an object(CheckPoint) the spawnPoint(this is where the player spawns/instantiated) will be moved to that checkpoint. I already know this script behind this which is

PlayerSpawnPoint.transform.position = new Vector3(494.21f, -8.413f,0f);

now the problem is. the Trigger is in the runController script and the runController script is instantiated with the player. which means the method calling the script as Public GameManager gm;
and calling it from runController won’t work since the runController script is not in the heirarchy. That method only works when the 2 scripts are outside or in the heirarchy. so how do I go about this problem?

ps. Ive already tried putting the Instantiated object/script in the heirarchy and putting the gamemanager, and then deleting the prefab and then putting it back. doesnt work when i tried it the gamemanager tab empty’s