You would normally leave this to the experts, but if you want to do it yourself, remove the top cover, but do not disconnect any cables. Find the battery and check whether it is soldered onto the main board, or plugged in. If it is a plug in, you can safely unplug it as long as you have the machine powered ON in REG mode. This will make sure the memory is not erased. Solder the new battery to the leads (always user the same type of battery) and plug it back in. If the battery is soldered to the board, you need to back up your programming first and take any reports that you need, then unsolder and replace the battery with the power off at the wall. Then perform the MRS (RAM clear) and then restore the programming.
As I said, best to get a pro to do it. It only needs doing approx every five years. Normally, the dealer will have a battery replacement reminder sticker on the machine, but many no longer bother.
hope this helps.
-----------------------------------------------
If anyone needs more information, the Sharp XE-A506 manual can be found at C-tech here:
http://the-checkout-tech.com/manuals/cashregisters/Sharp_XE-A506_instruction_programming_manual.html
Registerman, June 2011