Very carefully - they are sometimes brittle (though not usually too bad if they aren't old) and just held on by friction. I would slide something thin and rigid under two sides and apply force evenly, straight back towards you. Don't apply force at an angle, and don't squeeze them. Wiggle just a tiny bit to help break them loose.
Do you have to remove them, though? They might not be mounted on a PCB - often they're wired. Can you just unplug them and leave them attached? I try to never remove knobs unless necessary.