A 500 status tells you where the failure surfaced, not what caused it. Use a disciplined sequence to shorten the search.
An HTTP 500 response is a category, not a diagnosis. Start by capturing the exact request, timestamp and environment. Then inspect the application and server logs immediately around that event.
Stack traces often contain framework noise. The highest-value frame is usually the first one that points into your own application code or configuration.
Reproduce the problem in a non-production environment with appropriate debug logging. Do not expose stack traces or secrets to public users.
Check recent deployments, environment changes, dependency changes, database connectivity and external service failures before rewriting code.