With a flat plastic tool (metal may cause damage to the mechanism underneath) it's easy to detach a key from an iMac keyboard. Just be gentle.
This video is part of our guide to replacing keys on Mac keyboards:
And if you want to see how NOT to remove a Mac key, take a look here:

Hey, thanks for your guide and videos. But do you know if it’s just the
same for the newer MBA models ? I want to clean underneath the keys of my
2014 MacBook Air.