Google provides specific support dates on its Pixel and Chromebook devices. For instance, under "About ChromeOS", mine says, "This device will get automatic software and security updates until 2027."
In case of doubt you can always replace the OS with whatever Linux distribution you choose, which only leaves closed-source driver/fw blobs - but that problem is shared with every other general-purpose computer these days.