Hospital staff will be urged to look out for patients who drink heavily or smoke in an NHS drive to prevent ill health.