Teleport 2D Character on TriggerEnter

I am currently making a simple game for year 1 game design, and for some reason just can’t figure out how to make my 2D character teleport along the X axis when he enters and presses “e” a trigger. Even helping me get him to move only upon entering the trigger, and not having to press a button would be of great help. Here is my current void OnTriggerEnter2D(note: the top portion is obviously irrelevant to the translation):

 void OnTriggerEnter2D(Collider2D col)
       if (col.CompareTag("Coins"))
            gm.points += 1;

       if(col.CompareTag("Door") && Input.GetKeyDown("e"))
            transform.position = new Vector2(transform.position.x + speed, 0);
            print("door working");


I also have this way above the prior bit of code:

 public float speed = 50f;

Please check this link out. It is written for 3D but can be easily adapted for 2D.

See it:

And do the Input.GetKeyDown(“e”)) in other local in script.