This depends on your terminal. A cross-platform crate for this is crossterm.
Alternatively, you can try to print \x7F (decimal 127, the ASCII Backspace character). On some terminals, this causes the cursor to go back (but doesn't actually delete the printed text, you need to print over it to do that. Using a whitespace will do)