OBS, or Open Broadcasting Software, is probably the best software for recording and streaming gameplay online. It's widely used in the streaming community for its stability, compatibility with streaming platforms, and low CPU/GPU consumption. It can also record gameplay up to 4K at 60 fps. Although, you should know that the file sizes of the recordings are going to be absolutely huge. So, if you have anything less than 2TB of space, you better start thinking of getting some more space.
There are plenty of software options out there that will record your gameplay such as Streamlabs OBS, NVIDIA GeForce Experience, Radeon ReLive, etc. The max resolution that these tools can record your gameplay in would generally be the same as your display. Also, all these tools will offer you the standard 30fps and 60fps options.
However, these will record raw videos without any sort of compression. This means you’ll have giant video files for which you’ll need sufficient space on your drive.