Vaseline can help prevent corrosion on top of the battery terminals but since Vaseline doesn't conduct electricity very good you shouldn't put it on the battery terminal itself before connecting the battery otherwise you'll get a bad battery connection.
Clean the battery posts and battery terminals first and then hook the battery up and then put some Vaseline on top of the battery terminal connections.
You can also buy some grease for electrical connections at an auto parts store which conducts electricity and can prevent corrosion on the battery terminals.
If you have corrosion on the battery terminals you can use some Coca Cola or baking soda and water to get rid of the Corrosion.
Then just use a garden hose to wash the battery terminals off and get rid of the corrosion.