The most common cause of a heart attack is athereosclerosis, a build up of plaque, which in turn, is caused by too much fatty foods,
hypertension (high blood pressure), smoking, etc.
Heart attacks can often come without warning, so it is not always preventable if you mean medication wise, but not smoking, eating a healthy diet, and losing weight can help.
Even though sometimes heart attacks come on suddenly, alot of people report chest pain that radiates to their arms.