Hello Tiahnaleigh
Hi, I'm Karl and will be happy to help you today.
There is no option that can prevent someone from trying to log into your account - it is simply not possible for either a Microsoft or any other account.
What you need to do is ensure that the password to your account is not used anywhere else that you may have signed up for something.
You can always check the activity on your account for any unexpected successful logins using this link
https://account.live.com/Activity
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.
https://haveibeenpwned.com/
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-collection-1-data-reach/
How Do Spammers Get My Email Address?
https://www.lifewire.com/how-do-spammers-get-my-email-address-2483607?utm_campaign=computersl&utm_medium=email&utm_source=cn_nl&utm_content=17601438&utm_term=
Protect your privacy on the internet
https://support.microsoft.com/en-us/help/4091455/windows-protect-privacy-internet
Protect yourself from phishing
https://support.microsoft.com/en-us/windows/protect-yourself-from-phishing-0c7ea947-ba98-3bd9-7184-430e1f860a44
*** 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.
Just so there is no misunderstanding, this is a public user-to-user support forum. We're users just like you helping other users. We do not work for Microsoft and have no access to any user account so there is nothing we can do or check from within the forum.