Maintaining good hygiene can prevent most cases of the Balanitis.
Make sure that you use enough soap and water and make sure that not any soap is left on the foreskin and rinse thoroughly.
Making sure that your partner does not have any sexual transmitted diseases can surely do a lot of good.
Using latex condoms during intercourse can help in preventing infections of any sort.
Make sure that the penis is not injured and if injured by some accident, give priority towards its treatment.
Carelessness can lead to complications in injuries over time and the inflammation might occur.
Make sure that the area under the foreskin is clean.
Weight reduction and getting rid of obesity can help prevent Balanitis, as obese people are more at risk.
Also make sure that Diabetes and other medical conditions are under check.
Frequent health checkups is always recommended to prevent and protect against any disease or infection