You'll often want to re-run a command. You could just type it out again, but assuming you don't have the WPM of ThePrimeagen, that's a pain.
You can use the up and down arrows to quickly cycle through your command history.
Focus your terminal window and use the "up" arrow key to start cycling through your command history. If you recently restarted your shell, then type a few commands first, like:
echo hello
echo world
Once you've cycled back through your history with the "up" arrow, you can use the "down" arrow to cycle back to the most recent command.
If your terminal is feeling cluttered with text, you can clear it with the clear command, or by pressing ctrl + l.
This won't delete your history, it will just clear the screen.