First, make sure that your xbox account and corresponding password are valid.
(Like logging into MS Store from a windows laptop with your xbox user).
If not, reset password until it works and you are sure about using it.
Then go to elitedangerous.com using the same laptop (with windows OS) and click the Frontier Auth to log in.
Do not enter a username yet.
When that window opens, you will see some options on top of the login window (Steam, Sony, Epic, Xbox).
One of them is the xbox icon (green ball X). Click on that. Wait.
It will ask you to authorize Frontier to receive access to your xbox ID and such.
After that you ahould be logged into Frontier with your xbox login and have linked your account to Frontier (and thus Elite D).
You should later use the same login to log into frontierstore.net later, by the way. And to ESDM.net. And to Inara.cz.
The log into your xbox with the same login.
Start elite dangerous core.
It will ask you which user to play with.
The current xbox user should already be offered, the same you had used on the PC to log into elitedangerous.com
It shouldn't ask you for a password now.
Begin flight training.