A. To me give up sweets was advised by doctor.
B. The doctor advised to give up sweets me.
C. I was advised by the doctor to give up sweets.
D. I was advised to give up eat sweets by the doctor.
Given sentence is in simple past tense and it is in active voice, we need to change it into passive voice.
Rule :
Subject + (was / were) + V3 + Optional Agents.