I seem to have an issue, and am not 100% sure it is from the Big Sur update, that everytime I watch a video it starts in the lowest definition. IT never did that before and I found no way to force it to do so. This is on Safari by the way.
Now replace const targetRes = to hd2160 to make all videos play in 4K quality, then save the script. If you want to only watch videos in 1080p then keep the script as it is. If you set targetRes to 2160 and the video only has 1080p available then the script will automatically find the best available video quality.
The only downside of this is that if you want to get Tampermonkey for Safari it costs money, while for Chrome its free. I havent yet found an alternative for Safari that would actually work.