With youtube-dl I first look what video quality is available and then in second step I download highest possible quality (in this example -f 137+140). Youtube-d
-f 137+140
Just use -f bestvideo+bestaudio/best for highest resulting quality available.
-f bestvideo+bestaudio/best
If you wanted to prefer MP4 format containers instead of WebM, use:
-f bestvideo[ext!=webm]+bestaudio[ext!=webm]/best[ext!=webm].
-f bestvideo[ext!=webm]+bestaudio[ext!=webm]/best[ext!=webm]