“Was tut Ihnen gut?” means “What makes you feel well?” The polite Ihnen asks what supports someone’s general well-being.