Microsoft needs to do what they can to convince people that they won't repeat the mistakes of this generation during the next one. That starts with investing in first party again, which they are clearly doing. The studio they are building and the studios they acquired are debatable as to how much impact that will have but it's a start. Unfortunately, I feel like Microsoft needed that to be bearing fruit NOW, not years from now. If they want the next Xbox to be in a better position from the start, they need to be convincing people now that their brand is worth it before the next platforms launch.
If they march into the next generation where the consensus is still that "Xbox has no games", then even rushing games out the door for the sake of having something Year 1 isn't going to help because those games will probably be greatly reduced in quality. I say Microsoft takes the slow road and ensures they have quality titles they are bringing to the table. Clearly, quantity didn't help them at the beginning of this generation. Though that means they'll probably still fall behind Sony for the next generation, the point is to make moves to establish yourself as a great creator of video games. Get the name "Xbox" out from being the butt of everyone's jokes to being a respectable competitor again. Worry about being number one after you've made sure you have what it takes to be number two. They feel like a distant third with how well Switch is doing right now.
No matter what Microsoft does, the only real hope they have for the next Xbox to overtake the next PlayStation is for Sony to screw up badly. Not outside the realm of possibility as we have seen but certainly not something to bank on.