Prevention is better than a cure because it literally prevents the discomfort and costs of becoming sick or experiencing a similar preventable event. It also often takes less effort to prevent something than to cure it, hence the popular expression "an ounce of prevention is worth a pound of cure."
Using common prevention strategies such as regular handwashing helps prevent illnesses like colds and flu from spreading. Taking the time to prepare and store food safely prevents food poisoning. In both cases, it is much more efficient and cost-effective to prevent the illness than to cure it.
However, the idea that prevention is better than a cure refers to more than just illness. The now common expression "an ounce of prevention is worth a pound of cure" originally came from Benjamin Franklin, who coined the phrase when he wrote a short essay about how to prevent house fires. As he noted, it was much less expensive to practice fire safety than it was to rebuild a house that burned to the ground.
Taking the time to prevent an inopportune scenario from happening, whether it is getting sick, causing a house fire or experiencing a careless accident, is always better than dealing with the scenario after it occurs.