This is because the sentence that Beatriz says refers to having pain (dolor) in her teeth (dientes). Then, Luisa advises her to go to the dentist (dentista).
This is the option that makes the most sense because you go to the dentist when your teeth hurt. The other types of doctors don’t make sense for this situation, so the answer is D.
Well, if you want the answer for "I would tell them to know what they want to do before going to college", then it's " Les diría que sepan lo que quieren hacer antes de ir a la universidad "