A new attitude!!
I do not claim, by any means, to be the best mother in the world, this is simply what worked for me. (First make sure the child isn't in some kind of genuine pain. I know by the whine or cry if it's real before my child even comes into the room and I know you do with yours too. It's a "mom thing".)
If a kid is whining because of some kind of imagined pain or illness...give them
Apple cider vinegar is very, very good for them, but it doesn't taste good and your child will not want any more "medicine".
If you think about it, children only whine because they want your attention. If they can convince you that they are sick, or in pain, you will comfort and pet them. If they are truly sick or in pain, then comfort away!! The day will come when you won't be able to comfort and pet anymore.
However, if they are making things up to get attention, give them what they want. As soon as the whining starts up...administer the medicine. (Don't get irritated and start yelling, just give them "medicine" and be as normal and happy as you can while you administer your meds.) I always tell them, "oh, I'm so sorry you aren't feeling well, let's find something to help make you healthier. There, that should help you out. Be sure you tell me the next time your leg is hurting so I can help you again."
They never do.
Then, I wait a few minuets and I find a good reason to give him/her attention; positive attention. Encourage him, congratulate him, teach him something new, have him help you complete a particular chore and then tell him you couldn't have done it without him....
There are plenty of GOOD ways to get/give attention. Being sick or in pain is not one of those good reasons, especially if the sickness or pain is not genuine. Whining is not appreciated in our house! This is my happy, healthy way to keep it away.