The following code is a remap to allow Ctrl+j to open a terminal tab which you can switch in and out of in vim. This is similar to VSCode's Ctrl+j shortcut but it is a full screen switch; it would be easier to implement it how VSCode does it but I like this better. Feel free to use this at your leisure!
Last_active_buffer = nil -- Variable to store the last active buffer
local function toggle_terminal_window()
-- Save the currently active buffer before switching to the terminal
Last_active_buffer = vim.api.nvim_get_current_buf()