You have to open the key, although in some fobs the key is removable. Either slide the key out or spring it away from the fob.
[header] How to replace the battery in a key fob [title] Move the key out of the way if it is in the fob. [step] This depends on what kind of fob you have. Car key fobs for example typically hold the key when it is not in use.