Many years ago we had this problem. Our daughter age 2.5, would NOT take the medicine. We told the doctor who basically told us she needed the medicine and who were the parents in our home. We felt a little foolish.
We went home, told her she had to take the medicine, no ifs, ands, or buts, and that once she did it, she could have a popsicle.
Worked like a charm and we ended up making a game out of it. Once she knew it was what was going to happen and our attitude was firm but loving, she did it.