Hydroxyurea works by inhibiting the DNA synthesis in cells, thereby preventing the growth and multiplication of cancer cells. It also increases fetal hemoglobin production in sickle cell anemia patients, which helps reduce the sickling of red blood cells.