Clear out the interference by moving your laptop away from other wireless devices like your phone, router, or microwave - I've dealt with this exact problem a bunch of times and it's usually something broadcasting on the 2.4GHz band messing with your keyboard's connection.
If that doesn't help, try uninstalling and fully reinstalling the Logitech Options software, then re-pair the keyboard fresh.
One more thing to check: make sure your laptop's Bluetooth drivers are current, since outdated drivers can cause random disconnects even when everything else looks fine. If none of that works after a year of solid performance, the Bluetooth module in the keyboard might be starting to fail, but honestly interference and software are the culprits like 90% of the time.