Does using Windows 11 and keeping up with the latest updates as soon as they’re available prevent that from happening, compared to the author’s setup? Nothing would help if you click on the wrong download link for your favourite software in either case, and an innocent PDF has hacked Linus Tech Tips nevertheless. At least, by not keeping up to date you’re not opening yourself to new bugs.