You may have Two-step verification set up on your account in which case you will need to generate an app password and use that to sign in rather than your regular Microsoft account password. So check out the following link that describes how to do that.
You can either generate an app password or disable two step verification, that's your choice.
If you still can't sign in then try the following
WARNING!! Before proceeding please ensure that you have the login details for your account to hand as the following steps involve removing your profile from the console, failure to know your login info can result in you having no access to your profile.
If possible please move your profile to a USB storage device just in case this doesn't work for you, at least then you will still have access to your profile.
Go to settings/ system/ storage, select your storage device and look for Profiles, select that and find your profile, delete your profile but please be sure to DELETE PROFILE ONLY. If your profile doesn't show in the Profiles section then you can skip the
profile deletion step. Deleting your profile only will NOT have any effect on your files/gamerscore etc.
Press B to back out until you get to the page that shows your storage devices, highlight your storage device and press Y on the controller, you will see a clear system cache option, clear the cache THREE ( yes THREE ) times one after the other, power the
console off and back on. Download the profile and then try signing in.