This article explains how to stream gameplay from an Xbox One to a PC. Both devices must be on the same Wi-Fi network, and the network connection must be strong and fast enough to handle streaming.
How to Stream Xbox One or Series X/S to PC and Play Games (Tutorial with No Input Lag)
The first step in streaming from Xbox One to PC is to enable streaming on the Xbox One. This is a fairly simple process:
Open System > Settings.
Select Preferences > Xbox App Connectivity.