Don't worry, there's nothing complex.
You just need to ensure you perform the necessary steps in the correct order.
1- First of all, since you've been away from your computer since quite a long period, you should ensure your Windows apps are still up to date. To do so, you need to go to your start menu and launch the "Microsoft Store" application. In there, go to your 'library" (button on the bottom left of the window) and push the button on the top right to trigger the search and download of updates. It might download a lot of things, so be patient and wait for it to complete. You might even want to reboot your computer once it's done.
2- You need to ensure you are still logged on to the Microsoft XBox network. To do so, go to your start menu, search for the application that is called "XBox" (a green icon with a white circle and green X inside) and launch it. When it appears, check if you are logged in with your Microsoft live account (it should show it in the top left corner). If not, log in. You can then close that window, the XBox app will remain active, showing a small black&white X icon next to the clock in the Windows taskbar.
3- If you have bought MSFS on Steam, you should launch Steam and let it download the update(s) for the MSFS launcher. If you have bought it on the MS Store instead, I guess the step1 might have done the trick already.
4- Launch MSFS. If needed, it will ask you to log in to your MS Live/XBox account, like in step 2 above. Then it will proceed loading and it will start to download the updates you're missing. At that step, ENSURE THE PROPOSED INSTALLATION PATH IS CORRECT ! Else it will not find your original files and it will then redownload everything...
Ah, also, there is not "logout" thing necessary here. You never need to log out MSFS. You can just close the sim (ALT+F4 works well too