Computers that old can have damage on the cable that leads up to the camera. Photobooth is a pretty generic software that should work. Apple menu -> About This Mac tells us the age of the computer.
If the machine is between mid-2010 and early 2011, you'll need to ensure the proper firmware is installed before doing anything:
https://support.apple.com/en-us/HT202313
Backup your data.
If you were able to install the firmware because you had the right edition, or a newer Mac, run command-option-shift-R to install the original system that came with your Mac on startup. Use Disk Utility to format the drive HFS Extended Journalled before running the installer.
Early 2010 and older Macs you'll want a 10.6.3 retail installer that looks like:
With an Apple or http://www.macsales.com/ DVD burner that uses USB 3.0 or earlier if you are missing the USB flash that shipped with your computer. Use Disk Utility to format the drive HFS Extended Journalled before running the installer.
Boot using the Option key the DVD for Snow Leopard.
Once you have installed the original OS or Snow Leopard retail, try running Photobooth again. If it still fails, you have a hardware issue with the computer making the camera fail. Logitech has some good Mac compatible webcams like the C615.
Upgrading back your OS to High Sierra is covered here. You may need to install 10.7 first.