Hello,
I'm very sorry for your loss. I understand that you are trying to access your late wife's computer so you can preserve her pictures and music before reformatting it.
What happens when you try to reset the password? Is the verification code being sent to her recovery phone number or email address?
Reset a forgotten Microsoft account password
If you don't have the credentials for her account, you may need to seek legal guidance on how to access the account. Microsoft provides information about this process in the article linked here.