These days I only use Windows PC and iPad. I don't have a Mac to test different methods unless I take out a retired Mac which has outdated OS and unprotected.
Before I posted, I tried to get this done using a Windows 10 PC. First I used VLC Player. Although it could download youtube video, it is not in 4K format. I heard that it is an limitation of the software. Then, I downloaded "4K Video Download+" (originally intended to download the free non-plus version but the trial plus version got downloaded instead). Although it could download youtube video, the image quality is also poor. I had the downloaded video played back side by side with the original one on a browser. The image quality of the video from the browser is better. Words on the screen do not look fuzzy compared with the downloaded one. So I guess "4K Video Download+" also downloaded a non-4K version. Not sure if it is a setting issue but the system chose the highest image quality by default. So I try to see if there is a better way to do it via an iPad.