Trying to learn how to troubleshoot an HTTP 500 error

I have a website running on EE4 (the same thing happened with EE3) that runs a “fetch” script to grab some images from a website whenever the post is updated and/or published.

This weekend I will be disabling all of the unnecessary plugins to see if the issue is still happening, but I would think that there is some log on my server somewhere that will tell me the cause of this HTTP 500 error.

I say it’s something wrong with the script, the developer blames the plugins, or VPS provider, or everything else he can think of. But there has to be a way for me to find out what is triggering this error.

I know the HTTP 500 error is rather vague, but if it is a PHP script then the exact reason should be in some PHP logs, right? Or if it’s caused by NGINX, then there has to be some logs that shows what caused it.

I would say the server is highly underutilized with 1GB of RAM being used (out of 4GB) and CPU utilization never ramping up over 50% (even under high traffic situations).

Does anyone have any idea how I can find the cause of this error?