my player keeps on freezing when i move sometimes it lets me move a bit but not for long before it freezes

here is movement script
public class movement : MonoBehaviour
{

public Rigidbody2D rb2D;

public float ForwardForce = 1f;
public float BackwardsMovementSpeed = -1f;
public float jumpForce = 1f;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    if(Input.GetKey(KeyCode.D))
    {
        rb2D.AddForce(transform.right * ForwardForce);
    }

    if(Input.GetKey(KeyCode.A))
    {
        rb2D.AddForce(transform.right * BackwardsMovementSpeed);
    }

    if(Input.GetKey(KeyCode.Space))
    {
        rb2D.AddForce(transform.up * jumpForce);
    }
}

}
and my rigidbody2d is not changed but i freezed the z constarint beacuse if i dont my player falls over if i try to move

Try to multiply the transforms by Time.deltaTime. It sometimes fixes issues with character movement.