Moving a 2D Object a certain distance over time with a single button click

Title kind of says it all, I’ve been trying to figure out how to make my 2D character move a specified distance on a single button click, not like a teleport, but like a dash or a dodge
so for example, If i pressed the z button, I’d want them to move 500 ft over the course of 2 seconds or something
I lost the code I was trying out due to some weird saving problem but I think I was honestly over thinking the problem anyway and writing overly complex code that didnt even work
I feel like there is a simple solution to this problem, but I havent been able to find it
If anyone knows something, I’d appreciate it!
Thanks in advance!

Hello i,d like to ask you in what way do you move your character. By using transform.Translate or by using your rigidbody?