Using respective software, third parties can monitor you through the camera on your devices and listen through internal microphones. The easiest way to prevent misuse of your camera is to put a sticker over it. This might seem silly, but a hacker will be preventing from viewing your activities, and you are able to decide more easily when to use the camera by taking off the sticker. Another option is to disable the camera function on your computer. Bear in mind that you will need to enable the functions each time you want to use either the camera or the microphone and that these threats similarly apply to your smartphone.
For more information watch these videos how to disable the camera on a Mac:
On a Windows product:
For how to disable your internal microphone on a Mac watch this video:
On a Windows device: