If you are on the device that you would like to keep, you are halfway there to get your issue solved. Here is how to sign out your Microsoft account everywhere.
Personal Microsoft Account
Your personal account will be one that was created directly with Microsoft (for example: msn.com, live.com, hotmail.com). You can manage and unlink devices associated with this account at https://account.microsoft.com.
School or Work Microsoft Account
A school or your work account will be the one that has the organization’s domain name. You can review and remove app and device access for this account at https://mysignins.microsoft.com/.
Removing a Connected Account from Microsoft Windows, Edge, and Outlook (New)
1. Press Windows Key + I
2. Select Accounts
3. Choose Access work or school
4. Selected the account and choose Disconnect