The NHS is facing one of the greatest challenges in its history: tackling waiting lists for elective treatments.