You do it with the built-in demo recording rather than any external hardware. Open the console and use the demorec command followed by a filename to start capturing, then demostop when you are done. The file is written to the game's demos folder and can be played back later with the demo playback command.
If you were instead asking about capturing video for upload, that is a separate job — an external capture card or a screen recorder like OBS will do it, and gives you a more shareable result than the native demo format.