The problem arises in that your login session carries across your browser tabs, preventing you staying signed in to the other account.
One answer is to use a different browser to sign into the alternative account. But you have a preferred browser for a reason, right? You might not like using another. A really simple alternative is to use a private browsing session.
Private browsing sessions are designed to not remember your browsing history or form entries once closed, so it’s also great if you are ever using a computer that is not yours to ensure none of your personal data is remembered on that device. But, they are also useful if you want to sign into another account as it keeps the session separate from the main browsing session.
Do note that private browsing sessions do not anonymise your activity on the internet, they only keep your activity private from the main browsing session.
There are some really useful keyboard shortcuts to open a private session
Firefox
CTRL+SHIFT+P opens a new Private Browsing window
Chrome
CTRL+SHIFT+N opens a new Incognito window
Edge
CTRL+SHIFT+N opens a new InPrivate window