Hi Barbara,
This is a very common side effect of spam. Typically it goes off in a week or two.
You can try the following method: You can log in account.micosoft.com your account on Microsoft's official website, click Security - View Credentials, and check for abnormal credentials, especially for successful login. You can change your account password to protect your account's security. Then, under Security - Manage login methods under "Sign out everywhere", you will see Sign out of all trusted devices, browsers, and apps, this will take effect after 24 hours. This interrupts the situation I described above. You can also click on the link below after logging in with your account. You can view all the platform permissions, and if there is a message for a third-party platform, it means that you will continue to receive messages from the third-party platform through your inbox's email manager. You can click Edit to remove the permission. Sign in to your Microsoft account
I hope this information helps. If you have any more questions, don't hesitate to reach out.
Otherwise, please take a moment to rate the answer. Wishing you good luck!