Statins: How the drug prevents heart attacks and strokes Heart attacks occur when the flow of blood to the heart is blocked, usually by a buildup of fat,