On most electronic safe locks, the battery sits in the keypad on the outside of the safe, so you replace it without opening the safe. Most locks warn you in time when the battery is getting weak, for example with a series of beeps when you enter the code or with a signal on the display. With certified locks, the programmed codes are kept when you replace the battery.
Replace the battery as soon as that warning appears. Use an alkaline battery from a well-known brand.
If the lock still does not open after replacing the battery, do not force anything. We can open the safe and repair the lock or replace it.