Usually by listening for weird noises in the microphone. That's a sign it's active, which could mean it is being tapped. Another possibility is the camera. There are ways to make the camera work but disguise it as if it isn't working. Use another phone camera and look at your phone through it. If there is a purple light coming from the camera, then it's active and possibly spying.