The sonic sunglasses were a device the Twelfth Doctor used to replace his sonic screwdriver after he abandoned it. He used them to recall the TARDIS after it had been dispersed by the HADS "dispersal" function. He earlier claimed he hoped they weren't scratched, hinting that the slightest scratch could make them unusable. (TV: The Witch's Familiar)
When he didn't use their function, he just wore them as regular sunglasses, specifically when he played his guitar at his 3 week party. (TV: The Magician's Apprentice / The Witch's Familiar)