You’re looking for a terminal multiplexer. A couple of popular ones are tmux and screen. Here’s a quick introduction to tmux: https://hackernoon.com/a-gentle-introduction-to-tmux-8d784c404340 …

Ubuntu VPS Hosting via How to use multiple terminals on Ubuntu server?.