What is the difference between a masochist and a sadist?

One likes to feel pain. The other likes to cause pain.

A masochist is a person who takes pleasure in their own pain and suffering. Someone who derives sexual gratification from being subjected to physical pain or humiliation is also called a masochist. A sadist is a person who takes pleasure in inflicting pain, punishment, or humiliation on others.