On the 16/9/20 Apple launched iOS14 for the iPhone, within this update was a new privacy feature in the form of a tool that adds a small orange or green dot in the corner when an app makes use of the microphone or camera. If the dot appears, it means that an app has accessed one of those pieces of hardware recently and may be doing so to spy on the phone's user.
An orange light refers to the microphone, while a green one indicates that the camera is being accessed. If it does appear, swiping down from the corner of the phone to open up the control center will show which app was doing so. The control center should show either an orange or green dot, as well as a message indicating which app is responsible.
This appears to be an excellent privacy feature should cyber criminals install malware/spyware on an iPhone without the user being aware. Android does not appear to have a similar feature built in to their operating system, but I am led to believe there are apps that perform a similar function.