YouTube-DL is an open source, command-line program to download videos from YouTube. The GitHub repository contains a downloadable Windows executable.
FFmpeg is an open source “cross-platform solution to record, convert and stream audio and video.” A Windows executable version of FFmpeg can be downloaded from FFmpeg Builds.
I am primarily a Windows user, so I create a /youtube-dl/ subdirectory in my /downloads/ directory.
Then I put the YouTube-DL and FFmpeg executables in that directory.
To download the highest quality version of a YouTube video, I run CMD, navigation to the /downloads/youtube-dl/ directory, and use this:
> youtube-dl -f bestvideo+bestaudio --merge-output-format mkv [YouTube URL]
If the [YouTube URL] is a link to a YouTube playlist, YouTube-dl will helpfully download the entire playlist.