This isn’t a software recommendation (some good options have already been mentioned). It’s just a more general safety recommendation: avoid using free websites online to handle your files (converting, compressing, etc.), or in your case, downloading videos. Unfortunately, many of those sites trick you into downloading malware without you realizing it and are often run by scammers and criminals.
At first, I tried YT-DLG, but it wouldn’t let me download 1080p videos in MP4, only WebP.
MP4 videos were only available in SD. That’s when I tried YouTubeDownloader, which worked allowed me to download 1080p videos in MP4.
I am not sure, I know it is tricky. If you try a few of the online YouTube downloaders in my link I have found that many will download age restricted content that you can’t even browse normally without an account.