If you're trying to sign in to Office with your personal Microsoft account, but you're already signed in with your work or school account, you need to sign out and then sign in with the correct Microsoft account (or vice versa).
Another option is to open a private browsing session in a new browser window. (Search your browser's help if you don't know how to do this.) When you open a private browsing session your browsing data (history, temporary internet files, and cookies) isn't saved so you can sign in with a different account.