Welcome Zaid Ahmed!
Thank you for reaching out.
Based on what you described, when you click Sign in in the Minecraft Launcher, the Gaming Services sign‑in window briefly opens and then closes without completing the sign‑in. You can try the suggestions below:
Method 1: Reset Microsoft Store cache
The Minecraft Launcher uses Microsoft Store components for sign‑in, and a corrupted cache can cause the sign‑in window to close immediately. Please try this:
Press Win + R > type wsreset > press Enter > wait for the Store to open > restart the PC and try signing in again.
Method 2: Verify date, time, and time zone
Go to Settings > Time & Language > Date & Time, enable Set time automatically and Set time zone automatically, click Sync now, then restart and test again.
Method 3: Temporarily disable third‑party security software
Some third‑party antivirus, firewall, or VPN tools may block Xbox sign‑in components, causing the window to close instantly.
Temporarily disable any third‑party security software, restart the PC, and test sign‑in.
Hope one of these could help. Please let me know how it goes!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.