How can I get my Player (which is a square) to move smoothly in Unity 2d? I still need help, even though there are answers.

I can’t get my square to move. I want to be able to use the A and D keys to move my player (the square). This is what I currently have:
Edit: This is what I now have, and I can move my player, but i can only move it a little bit per keypress. Is there a way i can make it so that I constantly move, for as long as A or D is held down?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Sprites;

public class PlayerController : MonoBehaviour 
{
	public float speed;

	private Rigidbody2D rb;

	void Update () {

		if (Input.GetKeyDown (KeyCode.A)) 
	{
		transform.Translate (-Vector3.right * Time.deltaTime * speed);
	}

	if (Input.GetKeyDown (KeyCode.D))
	{
		transform.Translate (-Vector3.right * Time.deltaTime * speed);
	}
	}
}

Use this: Unity - Scripting API: Transform.Translate

I guess this is how it is supposed to work.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.Sprites;
 
 public class PlayerController : MonoBehaviour 
 {
     public float speed;
 
     void Update () {
 
         if (Input.GetKeyDown (KeyCode.A)) 
         {
             transform.Translate(-Vector3.right*Time.deltaTime *speed);
         }
 
         if (Input.GetKeyDown (KeyCode.D))
         {
            transform.Translate(Vector3.right*Time.deltaTime *speed);
         }
     }
 }

@Tona999
Now I can move my sprite, but it isn’t very consistent. Is there a way that if i hold down A or D, my sprite will keep moving?