How do you make the player move towards the mouse pointer?

I haven’t been able to figure this out as I’m new to c#, I’m wondering if anyone could help me out, thanks.

This is what I have so far:

	void Update () {
        var MouseX = Input.mousePosition.x;
        var MouseY = Input.mousePosition.y;
        var SpeedD = 20;
        var Player = this.transform.position;
        var T = Time.deltaTime;

        transform.position = new Vector3((MouseX - Player.x) / SpeedD * T, (MouseY - Player.y) / SpeedD * T, 0f);
        
    }

Well, mouse position is in screen space coordinates. That goes from 0 to screen size, 0 being in the left bottom corner.
Your character’s position is in the world space coordinates. It appears on the screen through the camera projection, but the coordinate system is different.
In order to move the character, you first need to somehow interpret the mouse cursor position in the world space. That’s a bit tricky, at least because the screen coordinates are 2D and world space is 3D. So this one is up to you to define. Most common, provided you have some kind of ground collider, would be to cast a ray from the camera, see where the ray hits the world, and viola, you have the 3D coordinates. There are some cases though, where this won’t work (eg. you don’t have anything to raycast agains).

So to do the raycast, you first need to know the ray. Ray will depend on the point of view, so you need to use the camera position and projection. Luckily, the camera already has what you need, method called ScreenPointToRay. So give it the screen pouse position, it will give you the ray. Then, use eg. Physics class to do a raycast with this ray. If the raycast hits, you can read the hit position in the world coordinates. Then just move your character towards it.