Creation of awareness among the people about the targeted diseases and their respective methods of prevention can contribute to a great extent towards prevention of various ailments. TV, Radio, Newspaper, organisation of discussions / talks by experts at various levels and at different places could serve the purpose of creating awareness.
When we talk about disease prevention we talk about two things in primary prevention - specific prevention and health promotion. Specific prevention will be something like spraying pesticides for killing malaria mosquitoes. Even as it stops the disease from occurring for that short period of time, it does not mean that we have controlled disease forever. We will have to keep on spraying the pesticide time and again. This would - 1. Increase chances of toxicity or ecological damage, 2. Incur huge costs of repeatedly spraying pesticides. Though this kind of prevention may be good for certain diseased where specific vaccinations are available, but, again a continued research and development on vaccines and making them available for a cost that everyone may afford does put a strain on the resources.
Going on with the example of malaria - if the people adopt a healthier lifestyle and stop letting water getting stagnated in the neighbourhood - either by ensuring proper drainage, or changing their lifestyle in any other way - they will not need to be afraid of malaria. Additionally this change in lifestyle will also give them protection from many other diseases for a longer time than specific prevention. It will not incur much cost.
Therefore, I feel that health promotion is the most efficient method of disease prevention. Epidemiology is the backbone of public health. We cannot think of a public health measure without knowing epidemiology. Community pharmacy may help in specific protection and as an adjuvent in secondary and tertiary prevention. It may also be useful in health promotion, however, to a more superficial level - by, maybe, providing nutrient supplements etc.