While there are plenty of third-party apps and services you can use to record your Steam gameplay, you now have a native option built right into the Steam client. Valve has launched its game recorder in beta, and yes, it also serves as a native recorder on the Steam Deck. You can set the feature to start recording in the background the moment you continue playing or set it to only start (and stop) recording when you press a hotkey. If you choose to record in the background, you can specify the maximum amount of storage that recordings can take up. Steam will overwrite old recordings once you reach the limit.
A replay feature will let you see previous footage in the Steam Overlay, so you can see what you did wrong in case you lose a boss fight or take a wrong turn that causes you to lose. You can even place bookmarks beforehand to make it easier to find clips you think you'd like to watch later. The new feature also makes it easier to send clips from the Steam Deck to your PC or mobile device if you want to share them with friends or upload them online.
Valve says the feature will only capture footage of your games and not your desktop, but may include audio from voice chat programs. It will also work for most games, even non-Steam titles, as long as they support Steam Overlay. However, since the feature is still in beta, you will have to join a beta program to access it. Go to Beta Participation in the Interface in Settings to choose a beta program and then activate the Game Recording option that appears in the Settings menu.