When you are working on a feature, and not using git worktree you create a new branch and switch to it using git switch -c <branch> or maybe even git checkout -b <branch>. Once you do this, you are no longer in your previous branch.
You can of course always switch back using git switch <other branch> or git switch - to go the last branch.
However, this only works if your working tree is clean and still you cannot view files from two different branches at the same time. Stashing is one possibility with its own disadvantages.
You can also copy your full repository clone. This has the disadvantage that you have the whole history multiple times on your drive and you have to keep each of these in sync with your remote.
Using git worktree, you can have multiple branches in different directories on your drive but all of them are linked to the same clone of the repo.
Enter the directory of your cloned repository. Keep this on main.
git worktree add <location> <optional: branch>
adds a new worktree at the given location. Either give a branch name or the name defaults to the name of the directory. You can enter your branch by cd'ing to that directory and of course by cding back, you are back in your main-branch.
Note that the location of the worktree can be outside of the directory of your repo and it makes sense to have it outside. I recommend creating a directory for worktrees next to your repo with the suffix .wt and keep all your worktrees inside.
You can list all your worktrees of your repo using git worktree list.
Worktrees are removed using git worktree remove.
In contrast to switching a single worktree between different branches, your node_modules are not present in the worktree, so you will have to do npm ci to install again all your dependencies. It is handy to switch your project to pnpm so that you can use pnpm install --frozen lockfile. Since it is using a cache, populating new worktrees is fast and does not require a network connection after the cache is populated for the first time.
Also, for working with multiple worktrees at the same time, the terminal multiplexer cmux turned out to be useful.