There are a lot of different ways that a modern smartphone can be compromised and made to monitor its unwitting owner, but some of the most involved and invasive methods involve hijacking a device's cameras and microphones. It can be hard to tell when you've fallen victim to a hack of this sort and are being watched and listened to, and it can be even harder to get rid of this kind of surveillance; after all, getting rid of your phone just means that your new phone gets compromised. If you know this sort of hack has taken place, there are steps you can take to "go black", or cut off all audiovisual data for the hacker. VICE, a new show hitting HBO, sat down with former NSA contractor and security buff Edward Snowden to ask how to do that.
While it may be next to impossible to cut your unwanted observer off entirely, Edward Snowden points out that you can rob them of a lot of data by simply removing your phone's microphones and cameras. While it may be a very drastic step, you can still make phone calls via a headset with a microphone, and all of the other normal functions of your phone are left intact, so long as they're not related to the camera or the microphone. Mind you, if you have, in fact, fallen victim to surveillance via your device's camera and microphone for one reason or another, it's highly likely that anything at all you do on the phone will be monitored, making it a better idea to stop using the device entirely, if possible.
Bear in mind that such hacks are quite uncommon and, for the most part, if you're in the crosshairs of a government agency like the NSA, there will probably be other ways to tell besides the behavior of your phone. Paranoid talk and conspiracy theories abound in this day and age, so careful consideration should go into a decision to mutilate your device like this, and it should only be done if you know for certain that the device has been compromised. After all, though a removed camera or microphone can be replaced, diving into your phone to retrieve them is almost certain to void your warranty.