Hello,
To recover a hacked or compromised Microsoft account:
Step 1: Clear your PC of viruses or malware before you change your password
If you have a good antivirus program installed, make sure it's up to date and then do a full scan of your system. If you don't have an antivirus app installed on your PC, Microsoft offers some solutions if you're running Windows 8.1 or Windows 10/11.
If you're running Windows 8.1 or Windows 10/11, you already have Windows Defender. Do the following to turn on malware protection:
Select Start
On the Start screen, type Windows Defender in the Search box, or select Windows Defender.
Follow the instructions on the screen.
Important: Regardless of which antivirus app you install, run a full scan on your PC before you change your password. You should also set up your antivirus app to automatically get updates and scan your PC on a regular basis.
Step 2: Change or reset your password
After you run the antivirus app, sign in to your account and change your password. Make sure you create a strong password.
If you can't sign in, reset your password.
Step 3: Check your account settings
Because someone else had access to your account, we've reset some of your account settings. To check and change your account settings, go to connected accounts, forwarding, and automatic replies.
To enhance the security of your Microsoft account, we suggest enabling two-step verification. How to use two-step verification with your Microsoft account
If the Answer is helpful, please click "Accept Answer" and upvote it.