Premium users can enable "Smart Downloads," which automatically saves recommended videos to your device based on your viewing history when connected to Wi-Fi.
The most secure and legally compliant method for downloading videos is through a YouTube Premium subscription. This service provides a built-in "Download" button directly below the video player on mobile devices and select desktop browsers.
If you are a content creator, you can always download your own uploaded videos directly from without a Premium subscription. How to Download YouTube Videos Legally - TechSmith