When it comes to safes, a lockout is never a good situation.
It can often be very costly to open and then repair the safe. Regular service is the best way to minimize any lockout situations. If a safe is attacked, it’s designed not to open (or at least be very difficult) without a professional for a reason. So keep this in mind and call a professional to service your safe. Most manufacturers recommend once a year, but if the safe is only used a couple times a month and not every day, then every 2 years should be fine.
The most important thing about a mechanical safe is to never slap the dial. Slapping the dial is spinning the dial hard and/or fast, this makes the wheels inside the lock hit each other at a forceable rate. This creates an audible slapping noise as the wheels hit each other. Many of these wheels are made of brass, it’s corrosion resistant, but a soft metal. When you slap them together, that brass eventually deforms, which can cause problems in opening the safe. Take care when dialing your combination and don’t spin the dial too rough.
Electronic safe keypads
At the very least, be sure to replace the batteries regularly. How often depends on the amount of use it gets. Once a year is usually plenty, replace them when you replace your smoke and CO detector batteries. Avoid using cheap batteries, get the good ones. I have been called out to a malfunctioning safe many times and find out that the customer has replaced the batteries with a discount brand.