Record a game clip on your PC with Game Bar - Microsoft Support
Game Bar is built into Windows 11 so you can capture videos and screenshots while playing PC games. While you're playing a game, press the Windows logo key + G on your keyboard to open Game Bar. If you have an Xbox 360 or Xbox One controller plugged in to your PC, press the Xbox button.