On Windows 10, go to Settings > Gaming > Xbox Networking if you can't connect to an Xbox multiplayer game. If you're using Windows 11, launch the Xbox Console Companion app, go to Settings, and then to the Network tab. Then double-check that Server connectivity is no longer marked as Blocked.