Camera movement issues

So I am trying to make a "crossy-road " style game. But I don’t know how to handle smoothly when the player is moving to fast and trying to get out of the screen. Any idea?

This is my solution for now.

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

public class cameramovement : MonoBehaviour
{
    public GameObject player;
    public float speednormal;
    public float speedrush;
    private float subs;

    private void Start()
    {
        subs =Mathf.Abs(player.transform.position.x - transform.position.x);
       
    }




    void Update()
   
    {
       


        if (Mathf.Abs(player.transform.position.x - transform.position.x) < subs+4)
        {
            transform.position += new Vector3(speednormal, 0, 0);
           
        }

        else
        {
           
            transform.position += new Vector3(speedrush, 0, 0);
           
           
        }



    }  
}

First switch you move code from Update() to LateUpdate(), LateUpdate is called after the update.
Second FPS can also cause these delays, Use Time.deltaTime Like this

if (Mathf.Abs(player.transform.position.x - transform.position.x) < subs+4)
        {
            transform.position += new Vector3(speednormal * Time.deltaTime, 0, 0);
          
        }
        else
        {
          
            transform.position += new Vector3(speedrush * Time.deltaTime, 0, 0);
          
          
        }

Time.deltaTime is the time took from switching one frame to another.

Thank you!