Hello,
To recover a hacked account, you might use this link:
How to recover a hacked or compromised Microsoft account - Microsoft Support
How to close your Microsoft account - Microsoft Support
Microsoft allows users to link multiple accounts, either for family sharing or other purposes. If you've linked your compromised account with another Microsoft account at some point, the hacker could have accessed information from the linked account as well, including devices connected to it. Or they could obtain the information from your E-mails etc.
Microsoft account dashboard on the dashboard, we can find devices connected to account.
Later you may try two-step verification, it helps protect you by making it more difficult for someone else to sign in to your Microsoft account.How to use two-step verification with your Microsoft account - Microsoft Support
If the Answer is helpful, please click "Accept Answer" and upvote it.