I am not a teacher.
Welcome to the forum.
If this is homework, we don't do that for you.
You are encouraged to try to answer yourself before anyone here will comment. Since that's what you've done in the second question I can tell you that D. is the right answer. You admit to something, or to doing something (in all conjugations). Answer D. is the only one that fits.
In the first sentence, the doctor advised you to do something. So what do you think the answer is?
Student or Learner