To search for and eliminate malfunctioning elements or errors in something, especially a computer program or machinery.
To remove a hidden electronic surveillance device from (somewhere).
To remove insects from (somewhere), especially lice.