Clean battery terminals and connectors well. Be sure connectors are tight on the terminals. Be sure you have a solid clean frame ground. I know, this is pretty basic but it's a good starting point. Use a meter to measure your battery voltage. It should read about 12.6 volts but make a note what it is for reference. Now start the tractor and measure the voltage at the battery. It should be around 14 volts. This will show whether your charging circuit is working. You should confirm that before going further. You don't describe your problem well but it sounds as though you might have current leakage when your tractor is not running. You may get some insight into that by pulling fuses one at a time to see where the current draw lies. There should be no leakage current with the key turned off. This will involve one circuit at a time troubleshooting.