A correction: 'What is the difference between abstain , refrain and restrain'.
Abstain and refrain are very similar. Abstain is usually used for 'bigger' things. You can abstain from Sex, Alcohol and voting! Refrain is usually used for smaller, less important things, and for shorter times. You can refrain from singing in class, you can refrain from spitting in public.
Restrain is usually when you stop someone or something else from doing something. You can restrain your dog, or restrain an angry friend. Although you can also restrain yourself. So - by abstaining from something, your are restraining yourself, or restraining your urge to do that thing.
So: He abstained from sex for three days after his operation. He refrained from picking at the scar. She restrained her dog, after it tried to bite the cat.