Aspirin prevents pain by stopping the formation of chemicals called prostaglandins, which help to send pain signals to the brain. Aspirin specifically locks down an enzyme called cyclooxygenase 2 (or COX-2), that makes prostaglandins.
Prostaglandins, however, also cause tiny particles in blood (known as platelets) to stick together and form a blood clot. By inhibiting prostaglandin production, aspirin slows clot production.
This can be bad. When you have a bloody nose, for example, you want a clot to form. Blood clots, of course, can be damaging as well. Some can cause heart attacks by clogging the blood vessels bringing oxygen and energy to the beating heart. A doctor, therefore, may suggest to adult patients that they take aspirin to prevent heart attacks. Aspirin can also help people who've already had a heart attack stay alive.