First, get him to a vet for an exam and bloodwork. This is a behavior change and so he needs to be OK physically. Hearing and eyes need to be checked.
Whining is typically a sign of stress. It is not an easy thing to "stop" other than not rewarding the dog for it. Only reward the dog for silence. If the dog is whining for dinner, no dinner is served until the dog is silent. If the dog is whining for attention then he is ignored until he is silent. That is your best route.
FIRST get to a vet and get a thorough exam.
Whining is typically a sign of stress. It is not an easy thing to "stop" other than not rewarding the dog for it. Only reward the dog for silence. If the dog is whining for dinner, no dinner is served until the dog is silent. If the dog is whining for attention then he is ignored until he is silent. That is your best route.
FIRST get to a vet and get a thorough exam.