Citizen makes watches that never need a new battery. The battery is constantly being recharged based on motions made by your hand. So we can obey the laws of thermodynamics and recharge our batteries without having to worry about where the energy is coming from.
If you want to make “self-charging” batteries, you need a source of energy, like solar panels or whatever. Perhaps you can take advantage of some other constant motion in order to recharge the battery you are thinking of. You just have to be clever about capturing energy. Energy is being thrown around all over the place all the time. If you can find a way of capturing some of it, then you might be able to use that to recharge a battery.
People use wind and sun and waves and the flow of water and geothermal temperature differentials. The potential sources of energy are all over the place, waiting for someone to develop a means of converting that energy into battery charging.