Modern mirrorless and DSLR cameras that produce clean HDMI output (meaning, no overlays on the screen), will give you the best results. As you might have guessed, though, this software isn’t free. However, third-party software has sprung up that allows you to use many Nikon and Canon cameras for this purpose. Unfortunately, this seems to be a less common feature nowadays.
Some compact point-and-shoot cameras are bundled with first-party software and drivers that allow you to use them as webcams. The ability to use your camera as a webcam is largely dependent on which camera you own.