Afflict vs. inflict
Afflict, which takes the preposition with, means to impose grievous physical or mental suffering on.
Inflict, which takes the preposition on, means to mete out or impose (something on someone).
they also use objects differently. The direct object of afflict is the person, group, or thing suffering from the affliction (e.g., she afflicted him with great mental distress).
The direct object of inflict is the agent of suffering (e.g., he inflicted great mental distress on her).
Afflict‘s corresponding noun is affliction (synonymous with disease, misfortune, and suffering).
Inflict‘s corresponding noun is infliction (synonymous with imposition, enforcement, and exaction).