On Windows, any Windows 7/8/8.1 users got a free upgrade to Windows 10, and the minimum requirements for Windows 10 are the same as Windows 7 (other than for disk space, Windows 10 requires less). So that's any Windows PC in the last 11 years can still get an OS with security updates. And of course, you can always install Linux on a Windows PC.
The Apple side doesn't go quite as far back, but still most 2012 macs can install Catalina which will be supported until 2022. And Linux is pretty well supported on the non-T2 macs (pre-2015) as well.