Do you have a second key?
It’s important that you do. You need one working key to access the car’s security system to add a new key. If your only key fails you will need a new security module and matching keys to get the car working. By “working” I mean able to start the car. There are two bits to the fob. The immobiliser which allows you to start the car, and the remote which opens the doors. Only the remote bit needs the battery power.
Get a second working key. There’s a guy on Facebook called “Ron Saab Leeds” who can do them at a reasonable price.
If the plastic part of the key fob looks OK, you may have a broken micro switch on the circuit board inside. There are kits to fix this. If the plastic case is broken, a new case is quite cheap. Get one with real buttons, not the cheaper ones with painted l buttons” that rely on the plastic case flexing.