You cannot completely prevent pancreatitis caused by gallstones. But you may be able to reduce your risk of forming gallstones by staying at a healthy weight with a balanced diet and regular exercise. For more information, see the topic Gallstones.
You can reduce your chance of having pancreatitis by not drinking alcohol excessively. The amount of alcohol needed to cause pancreatitis varies from one person to another. Generally, moderate consumption is considered no more than 2 alcoholic beverages a day for men and 1 a day for women and older people.
Smoking may increase your chance of having pancreatitis. If you smoke, it's a good idea to quit.