OBS Studio for sure. It’s awesome. You can configure a bunch of different video input sources, even capture simultaneously from more than one.
Just make sure the camera has a decent resolution. A webcam from a couple years back often got 3.1 MP and a native resolution of 480p and less.
Best video format for recording is mkv (easy on the CPU), then you can cut it with DaVinci Resolve (free!) and export to mp4. Youtube will do the rest during upload.