Drishtanushravik vishaya vitrishnasya vashikaar sangya vairagyam
Vitrishnasya: Lose interest in, free from desire
Having described Abhyaas as the first tool to achieve Yoga, Sage Patanjali delves on the second tool - Vairagya (detachment), and defines it as that controlled state where one is free from the desire of what is seen or heard.
Detachment is not running away from your desires/attachments but evolving to a state that they do not have an effect on you. It does not also mean living in isolation or suppression of the senses, but a state where whether something is there or not, it does not have an effect on you.