How can I make this character move smoothly?

so my script is:

public float speed = 50;

bool isinRL = true;
bool isinLL = false;

void Update ()
{
    transform.Translate(0, 0, speed * Time.deltaTime);

    if(isinRL && Input.GetKeyDown(KeyCode.A))
    {
        isinRL = false;
        transform.Translate(-5, 0, 0);
    }
    if (isinLL && Input.GetKeyDown(KeyCode.D))
    {
        isinLL = false;
        transform.Translate(5, 0, 0);
    }
}

void IsInRL()
{
    if(!isinRL)
    {
        isinRL = true;
        isinLL = false;
    }
}

void IsInLL()
{
    if(!isinLL)
    {
        isinLL = true;
        isinRL = false;
    }
}

I need help finding out how I can make this part:

    if(isinRL && Input.GetKeyDown(KeyCode.A))
    {
        isinRL = false;
        transform.Translate(-5, 0, 0);
    }
    if (isinLL && Input.GetKeyDown(KeyCode.D))
    {
        isinLL = false;
        transform.Translate(5, 0, 0);
    }
}

when it says transform.translate, what I need help with is how do I move the character smoothly, because for me it just teleports there and anything else i try does not work, thanks!

I haven’t tested the following code, but give it a try:

private float remainingXDistance = 0;

void Update ()
 {
     // Here, I suppose speed > 0
     float absoluteDelta = speed * Time.deltaTime ;
     float delta = absoluteDelta * Mathf.Sign( remainingXDistance ) ;
     if( absoluteDelta > Mathf.Abs( remainingXDistance ) ) delta = remainingXDistance  ;
     remainingXDistance -= delta ;

     transform.Translate(delta, 0, absoluteDelta );
     if(isinRL && Input.GetKeyDown(KeyCode.A))
     {
         isinRL = false;
         remainingXDistance -= 5 ;
     }
     if (isinLL && Input.GetKeyDown(KeyCode.D))
     {
         isinLL = false;
         remainingXDistance += 5 ;
     }
 }