Hi, I'm Karl and will be happy to help you today.
First, to check whether or not you have been hacked, use the following link
https://account.live.com/Activity
While Microsoft does send out "unusual activity" messages, there are many phishing scams that look very realistic. In those cases, when you click on the link in the message, all you are doing is letting the spammer know that this is an active email address which in turn will result in a lot more spam.
When you check your account activity and do not see any matching details as reported in the email message, it is a phishing scam.
The following is a standard reply I give to those who ask about a sudden increase in <spam> and <unexpected> log in attempts describing how email addresses are harvested which you may find of interest
The usual source of a sudden increase in failed login attempts or spam mail received is that the email address was harvested by a hacker who breached a data base on a website where you subscribed to something. That database gets repeatedly sold to other hackers/spammers on the dark web.
Many people think that hackers penetrate the actual Microsoft servers to gain access to email accounts when that isn't the case. Instead they gain access to an actual account via any number of other ways including phishing emails.
You can check to see if the email address comes up on a breached database on the following website created/run by Microsoft MVP Troy Hunt.
Pwned websites
https://haveibeenpwned.com/PwnedWebsites#Epik
Other articles that may be of interest
The 773 Million Record "Collection #1" Data Breach
https://www.troyhunt.com/the-773-million-record...
How Do Spammers Get My Email Address?
https://www.lifewire.com/how-do-spammers-get-my...
Protect your privacy on the internet
https://support.microsoft.com/en-us/help/409145...
Protect yourself from phishing
https://support.microsoft.com/en-us/windows/pro...
*** if you find that the email address was on a breached website where a password was also entered, what you really do want to do is make sure that the same email address/password combination is NOT being used on other sites (i.e. Social Media, Facebook, Paypal, Amazon etc) and if that password is still the one being used on your email account - make sure to change it immediately. Not a question of <IF> a hacker will test those account(s) - just a matter of <WHEN>
Required Forum Disclaimer: Some of the above links are non-Microsoft websites. The pages appear to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the site before you decide to download and install it.