My personal computer is a MacBook Pro with the problematic butterfly keyboard (from 2018). I got a warranty replacement keyboard installed three years ago due to a few sticking keys, and it's been good ever since (knock on wood). I'm pretty careful about eating near it, due to that design, but otherwise just give it a wipe down with a damp cloth every once in a while.
Work issues us cheap Logitechs, which seem reasonably durable. I give that a periodic wipe-down/tap-out when I'm cleaning my desk. I do eat lunch there, so that definitely impacts its cleanliness more than anything else (if it's visibly dirty, it gets cleaned for sure).