how do I get controller input

I’m trying to get input from an Xbox controller’s left joystick using the Input.GetKeyDown command and I don’t understand how to, `if (Input.GetKeyDown(“d”))
{
rb.AddForce(new Vector2(150, 0));
transform.Rotate(0, 0, 5);
}

    if (Input.GetKeyDown("a")) 
    {
        rb.AddForce(new Vector2(-150, 0));
        transform.Rotate(0, 0, -5);
    }

    if (Input.GetKeyDown("space"))
    {
        rb.AddForce(new Vector2(0, 200));
    }`

how do I switch the Input.GetKeyDown to work with a controller

Controler Sticks Use an Axis from -1 to 1. Unity has created the same thing for WASD as well called Input.GetAxis(“AXIS_NAME”).
So switch Input.GetKey to Input.GetAxis for keyboard and controller.
read more here: Unity - Scripting API: Input.GetAxis