Is the issue specifically a password one? Does it say that? It helps to include the exact message.
I really think, though, that this is a Microsoft issue. For several years now it has been on and off with us getting access to Hotmail on Macs using Mail. Nothing has changed on our end, it's just that one day it might work and another it won't. We don't have any issues on iPhones. It also isn't necessarily a password issue. Usually it is simply a "cannot connect" issue which implies it's a server issue. Again, the iPhones still work and everything else in our house works so it isn't our router.
In our case we are running two different macOS versions on our computers. I rarely use my computer to read Hotmail but when I do it works. My wife uses it everyday and she is the one with problems. It's a connection issue and once changing servers seemed to clear it up, but other times it does not help but the next day things are working again. Again all pointing in Microsoft's direction.
Realize that Microsoft has no reason to ensure compatibility between its servers and Apple's Mail app. If you contact them then I will bet they will just tell you to use Outlook. I also don't think this is a widespread compatibility issue with Sonoma Mail since I haven't seen anybody else complain.
Also, have you tried signing in with a web browser? I don't know that that will provide a solution to the Mail application problem but at least it will tell you it isn't your computer having a problem talking to Hotmail.