Lovastatin is used together with diet, weight-loss, and exercise to reduce the risk of heart attack and stroke and to decrease the chance that heart surgery will be needed in people who have heart disease or who are at risk of developing heart disease. Lovastatin is also used to decrease the amount of cholesterol (a fat-like substance) and other fatty substances in the blood. Lovastatin is in a class of medications called HMG CoA reductase inhibitors (statins). It works by slowing the production of cholesterol in the body to decrease the amount of cholesterol that may build up on the walls of the arteries and block blood flow to the heart, brain, and other parts of the body.