Expressing Pain or Discomfort.
Many dogs whine if they're sick or in pain.
If your dog isn't feeling well, whining may be its way of getting your attention to let you know.
In some cases, the whining could be an effort on the dog's part to calm itself down rather than to get attention.