how to find the player without attaching a script to it

Hey. I want to start modding games but I quickly found out that I need to learn how to control everything without the editor, so I wanted to test some things and one of the things I wanted to do is to attach a movement script to the player via script but the script I wrote isnt working. here it is:

public float speed;
public GameObject Player;

void Start()
    Player = GameObject.FindWithTag("Player"); //trying to find the player via tags

void Update()
    Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), 0f, 0f);
    Player.transform.position = movement * Time.deltaTime * speed;
    //printing the player current position to the console


any ideas?

Did you add the Tag “Player” to the player object?
If you did, try, GameObject.Find("Player") and name the Player object to “Player”