You can keep your battery terminals from corroding by using some dielectric grease, Vaseline or even some anti corrosive spray.
You can take some dielectric grease and apply it on the battery terminals to prevent corrosion on the battery terminals and keep the battery connections working properly.
I use dielectric grease on my battery terminals and since I've started using the dielectric grease on my battery terminals and battery cable connections the corrosion has not been as bad as it was before.
I still sometimes get a bit of corrosion but not as much as I would have before using the dielectric grease on the battery terminals.
Vaseline works good on battery terminals as well but the dielectric grease works better and gives a better electrical connection.
Another way to prevent corrosion on battery terminals is to use some anti-corrosive spray which works great and sometimes even better than the dielectric grease or Vaseline.
You can clean the corrosion off the battery terminals by using some baking soda and water and pouring it onto the battery terminals or brushing some baking soda and water paste onto the battery terminals.
I would also recommend getting a battery terminal and battery post cleaner wire brush that are cheap at auto parts stores.