For occasional use, consider a subscription (~$99/year). It runs on Windows 11, includes cloud licensing, and is legal for hobbyists.
If you own a legitimate standalone or educational license for SolidWorks, you should always use the official activation window: Open SolidWorks and navigate to the activation prompt. Select . solidworks 2016 activator windows 11 upd