If the issue related to Windows device, please follow steps:
- To open Credential Manager, type credential manager in the search box on the taskbar and select Credential Manager Control panel.
- Select Web Credentials or Windows Credentials to access the credentials you want to manage.
- Look for Microsoft Office or Outlook, Remove them.
If the issue related to MacOS device, please check MS article:
How to remove Office license files on a Mac
Office 365 will be unlinced from the previous account.
Best regards,
Aleksandr
If the response is helpful, please click "Accept Answer" and upvote it.