The typical solution is not to delete your previous lines, but print the instruction in the next line and read from there so the user can see the (input/output) message history on the screen.
Update
If you really want to do what you just asked, you can clear the screen and then print to the empty screen again.
Have a look at this: https://www.geeksforgeeks.org/clear-screen-python/ (I'm assuming you're doing Python.)